.stickers-layer {
  position: fixed;
  inset: 0;
  z-index: 920;
  pointer-events: auto;
}

.stickers-layer[hidden] {
  display: none;
}

.stickers-layer::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.74);
}

.stickers-layer__actions {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 2147483647;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.stickers-layer__menu-wrap {
  position: relative;
  display: inline-flex;
}

.stickers-layer__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.stickers-layer__action:hover,
.stickers-layer__action:focus {
  background: var(--color-surface-hover);
  outline: none;
}

.stickers-layer__action:focus-visible {
  box-shadow: var(--focus-ring), var(--shadow-md);
}

.stickers-layer__action .ui-icon {
  display: block;
}

.stickers-layer__action--create {
  width: auto;
  min-width: 0;
  padding: 0 14px;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
}

.stickers-layer__menu.menu-popup {
  top: calc(100% + 6px);
  right: 0;
}

.stickers-layer__menu.menu-popup:not([hidden]) {
  display: block;
}

.stickers-layer__menu a,
.stickers-layer__menu a:visited,
.stickers-layer__menu a:hover,
.stickers-layer__menu a:focus {
  color: var(--color-text);
  text-decoration: none;
}

.stickers-layer__empty {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  pointer-events: none;
}

.stickers-layer__empty[hidden] {
  display: none;
}

.stickers-layer__empty-text {
  max-width: min(520px, calc(100vw - 48px));
  color: rgba(255, 255, 255, 0.94);
  font-size: 18px;
  line-height: 1.4;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.32);
}

.stickers-layer__empty-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.96);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  pointer-events: auto;
}

.stickers-layer__empty-action:hover,
.stickers-layer__empty-action:focus {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  outline: none;
}

.stickers-layer__empty-action:focus-visible {
  box-shadow: var(--focus-ring);
}

.sticker-window {
  --sticker-bg: var(--sticker-yellow-bg);
  --sticker-header-bg: var(--sticker-yellow-header-bg);
  --sticker-border: var(--sticker-yellow-border);
  --sticker-text: var(--sticker-yellow-text);
  position: absolute;
  min-width: 260px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--sticker-border), transparent 18%);
  border-radius: 6px;
  background: var(--sticker-bg);
  color: var(--sticker-text);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
  pointer-events: auto;
}

.sticker-window.is-dragging,
.sticker-window.is-resizing {
  user-select: none;
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.24);
}

.sticker-window[data-sticker-color="yellow"],
.sticker-color-inline[data-sticker-color="yellow"],
.sticker-window__color-button[data-sticker-color="yellow"] { --sticker-bg: var(--sticker-yellow-bg); --sticker-header-bg: var(--sticker-yellow-header-bg); --sticker-border: var(--sticker-yellow-border); --sticker-text: var(--sticker-yellow-text); }
.sticker-window[data-sticker-color="green"],
.sticker-color-inline[data-sticker-color="green"],
.sticker-window__color-button[data-sticker-color="green"] { --sticker-bg: var(--sticker-green-bg); --sticker-header-bg: var(--sticker-green-header-bg); --sticker-border: var(--sticker-green-border); --sticker-text: var(--sticker-green-text); }
.sticker-window[data-sticker-color="blue"],
.sticker-color-inline[data-sticker-color="blue"],
.sticker-window__color-button[data-sticker-color="blue"] { --sticker-bg: var(--sticker-blue-bg); --sticker-header-bg: var(--sticker-blue-header-bg); --sticker-border: var(--sticker-blue-border); --sticker-text: var(--sticker-blue-text); }
.sticker-window[data-sticker-color="pink"],
.sticker-color-inline[data-sticker-color="pink"],
.sticker-window__color-button[data-sticker-color="pink"] { --sticker-bg: var(--sticker-pink-bg); --sticker-header-bg: var(--sticker-pink-header-bg); --sticker-border: var(--sticker-pink-border); --sticker-text: var(--sticker-pink-text); }
.sticker-window[data-sticker-color="violet"],
.sticker-color-inline[data-sticker-color="violet"],
.sticker-window__color-button[data-sticker-color="violet"] { --sticker-bg: var(--sticker-violet-bg); --sticker-header-bg: var(--sticker-violet-header-bg); --sticker-border: var(--sticker-violet-border); --sticker-text: var(--sticker-violet-text); }
.sticker-window[data-sticker-color="orange"],
.sticker-color-inline[data-sticker-color="orange"],
.sticker-window__color-button[data-sticker-color="orange"] { --sticker-bg: var(--sticker-orange-bg); --sticker-header-bg: var(--sticker-orange-header-bg); --sticker-border: var(--sticker-orange-border); --sticker-text: var(--sticker-orange-text); }
.sticker-window[data-sticker-color="mint"],
.sticker-color-inline[data-sticker-color="mint"],
.sticker-window__color-button[data-sticker-color="mint"] { --sticker-bg: var(--sticker-mint-bg); --sticker-header-bg: var(--sticker-mint-header-bg); --sticker-border: var(--sticker-mint-border); --sticker-text: var(--sticker-mint-text); }
.sticker-window[data-sticker-color="gray"],
.sticker-color-inline[data-sticker-color="gray"],
.sticker-window__color-button[data-sticker-color="gray"] { --sticker-bg: var(--sticker-gray-bg); --sticker-header-bg: var(--sticker-gray-header-bg); --sticker-border: var(--sticker-gray-border); --sticker-text: var(--sticker-gray-text); }

.sticker-window__header {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 28px;
  padding: 3px 8px;
  background: var(--sticker-header-bg);
  border-bottom: 1px solid color-mix(in srgb, var(--sticker-border), transparent 24%);
  cursor: grab;
}

.sticker-window.is-dragging .sticker-window__header {
  cursor: grabbing;
}

.sticker-window__menu-button,
.sticker-window__tool,
.sticker-window__color-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--sticker-text);
  cursor: pointer;
}

.sticker-window__menu-button {
  position: relative;
  z-index: 6;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  line-height: 1;
}

.sticker-window__menu-button .ui-icon {
  display: block;
  width: 16px;
  height: 16px;
}

.sticker-window__menu-button:hover,
.sticker-window__tool:hover,
.sticker-window__color-button:hover {
  background: color-mix(in srgb, var(--sticker-border), transparent 58%);
}

.sticker-window__body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.sticker-window__offline {
  margin: 8px 10px 0;
  padding: 6px 8px;
  border: 1px solid color-mix(in srgb, var(--color-warning), transparent 25%);
  border-radius: 4px;
  background: var(--color-warning-soft);
  color: var(--color-warning-text);
  font-size: 12px;
  line-height: 1.35;
}

.sticker-window__editor {
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px 20px 12px;
  overflow: auto;
  outline: none;
  font-size: 14px;
  line-height: 1.45;
}

.sticker-window__editor p {
  font-size: inherit;
  line-height: inherit;
  margin: 0 0 0.7em;
}

.sticker-window__editor ul {
  margin: 0 0 0.7em;
  padding-left: 18px;
}

.sticker-window__editor a {
  color: currentColor;
  text-decoration: underline;
}

.sticker-window__toolbar {
  display: none;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  border-top: 1px solid color-mix(in srgb, var(--sticker-border), transparent 24%);
  background: color-mix(in srgb, var(--sticker-bg), var(--sticker-header-bg) 34%);
}

.sticker-window.is-focused .sticker-window__toolbar {
  display: flex;
}

.sticker-window__tool {
  min-width: 28px;
  height: 28px;
  border-radius: 4px;
}

.sticker-window__tool .ui-icon {
  display: block;
  width: 18px;
  height: 18px;
}

.sticker-window__resize {
  position: absolute;
  z-index: 5;
  width: 18px;
  height: 18px;
  background: transparent;
  touch-action: none;
}

.sticker-window__resize--nw {
  top: 0;
  left: 0;
  cursor: nwse-resize;
}

.sticker-window__resize--ne {
  top: 0;
  right: 0;
  cursor: nesw-resize;
}

.sticker-window__resize--sw {
  bottom: 0;
  left: 0;
  cursor: nesw-resize;
}

.sticker-window__resize--se {
  right: 0;
  bottom: 0;
  cursor: nwse-resize;
}

.sticker-window__menu {
  width: 140px;
  min-width: 0;
  color: var(--color-text);
  z-index: 2147483000;
}

.sticker-window__menu.menu-popup:not([hidden]) {
  display: block;
}

.sticker-window__colors {
  display: grid;
  grid-template-columns: repeat(4, 24px);
  gap: 8px;
  justify-content: start;
  padding: 8px 10px;
  margin: 0 0 4px;
}

.sticker-window__colors .sticker-window__color-button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--sticker-border), transparent 18%);
  border-radius: 4px;
  background: var(--sticker-bg);
  box-sizing: border-box;
}

.sticker-window__colors .sticker-window__color-button:hover,
.sticker-window__colors .sticker-window__color-button:focus {
  background: var(--sticker-bg);
}

.sticker-window__colors .sticker-window__color-button.is-active {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.sticker-window__menu-action {
  display: block;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: var(--list-size, 14px);
  line-height: 1.3;
}

.sticker-window__menu a,
.sticker-window__menu a:visited,
.sticker-window__menu a:hover,
.sticker-window__menu a:focus,
.sticker-window__menu button,
.sticker-window__menu button:hover,
.sticker-window__menu button:focus {
  color: var(--color-text);
  text-decoration: none;
}

.sticker-window__menu-action:hover,
.sticker-window__menu-action:focus {
  background: var(--menu-hover-bg);
  outline: none;
}

.stickers-list-table__preview a {
  display: block;
  max-width: min(720px, 70vw);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sticker-color-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sticker-color-inline__swatch {
  width: 18px;
  height: 18px;
  border: 1px solid color-mix(in srgb, var(--sticker-border), transparent 18%);
  border-radius: 4px;
  background: var(--sticker-bg);
}

.sticker-detail-content__body {
  max-width: 760px;
  line-height: 1.6;
}

.sticker-detail-content__richtext p {
  font-size: 15px;
  margin: 0 0 0.8em;
}

.sticker-detail-content__richtext a {
  text-decoration: underline;
}

.sticker-form .ck-editor__editable {
  min-height: 320px;
}

.sticker-editor-word-count {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 6px;
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1.35;
}

@media (max-width: 968px) {
  .stickers-layer {
    display: none !important;
  }

  .stickers-list-table__preview a {
    max-width: 100%;
  }
}
