.ky-cz-wrap {
  max-width: 1180px;
  margin: 24px auto;
  padding: 0 12px;
}

.ky-cz-wrap,
.ky-cz-wrap * {
  box-sizing: border-box;
}

.ky-cz-wrap {
  color: #1f1f21;
}

.ky-cz-wrap button,
.ky-cz-wrap input,
.ky-cz-wrap select {
  font: inherit;
}

.ky-cz-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(380px, 1.25fr);
  gap: 18px;
  align-items: start;
}

@media (max-width: 900px) {
  .ky-cz-grid {
    grid-template-columns: 1fr;
  }

  .ky-cz-layout-overlay {
    padding: 8px;
  }

  .ky-cz-layout-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .ky-cz-layout-actions {
    justify-content: flex-start;
  }

  .ky-cz-layout-workspace {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .ky-cz-layout-panel,
  .ky-cz-layout-preview {
    overflow: visible;
  }

  .ky-cz-layout-preview .ky-cz-a4-page {
    width: min(100%, 420px);
    max-height: none;
  }

  .ky-cz-layout-preview.is-preview-focus .ky-cz-a4-page {
    width: min(148%, 620px);
  }

  .ky-cz-a4-head {
    flex-direction: column;
  }

  .ky-cz-preview-mode {
    width: 100%;
  }

  .ky-cz-preview-mode button {
    flex: 1 1 0;
  }
}

.ky-cz-card {
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 24px;
  padding: 18px;
  box-shadow:
    0 20px 45px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 248, 250, 0.92));
  backdrop-filter: blur(18px);
}

.ky-cz-card h3,
.ky-cz-editor-head h4 {
  margin: 0 0 12px;
}

.ky-cz-card label {
  display: block;
  font-size: 14px;
  margin: 10px 0 6px;
}

.ky-cz-card input[type="number"],
.ky-cz-card input[type="time"],
.ky-cz-card input[type="date"],
.ky-cz-card input[type="text"],
.ky-cz-card select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.ky-cz-card input:focus,
.ky-cz-card select:focus,
.ky-cz-type-pill:focus,
.ky-cz-mini-btn:focus,
.ky-cz-btn:focus {
  outline: none;
  border-color: rgba(38, 99, 235, 0.35);
  box-shadow: 0 0 0 4px rgba(38, 99, 235, 0.08);
}

.ky-cz-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 640px) {
  .ky-cz-row,
  .ky-cz-slot-grid {
    grid-template-columns: 1fr;
  }
}

.ky-cz-btn {
  margin-top: 14px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 0;
  cursor: pointer;
  font-weight: 700;
  background: linear-gradient(180deg, #1c1c1e, #09090b);
  color: #fff;
  box-shadow: 0 10px 24px rgba(17, 17, 17, 0.18);
  appearance: none;
  -webkit-appearance: none;
}

.ky-cz-btn-secondary,
.ky-cz-mini-btn {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.86);
  color: #151515;
  appearance: none;
  -webkit-appearance: none;
}

.ky-cz-hr {
  border: 0;
  border-top: 1px solid #eee;
  margin: 14px 0;
}

.ky-cz-hint {
  opacity: 0.75;
  font-size: 13px;
  margin: 10px 0 0;
}

.ky-cz-storage {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: rgba(245, 247, 250, 0.8);
}

.ky-cz-media {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: rgba(245, 247, 250, 0.86);
}

.ky-cz-media h4,
.ky-cz-a4-head h4 {
  margin: 0 0 10px;
  font-size: 16px;
}

.ky-cz-media .ky-cz-btn {
  margin-top: 12px;
}

.ky-cz-media-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.ky-cz-media-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
}

.ky-cz-media-item.is-active {
  border-color: rgba(37, 99, 235, 0.62);
  background: rgba(239, 246, 255, 0.82);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.ky-cz-media-item img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
}

.ky-cz-media-fields {
  min-width: 0;
}

.ky-cz-media-fields strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ky-cz-media-select {
  display: inline-flex;
  margin-top: 6px;
  padding: 5px 9px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #1d4ed8;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.ky-cz-media-fields label {
  margin-top: 8px;
}

.ky-cz-crop-controls {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(37, 99, 235, 0.12);
}

.ky-cz-table-controls {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
}

.ky-cz-table-controls-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ky-cz-table-controls-head strong {
  font-size: 13px;
}

.ky-cz-media-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ky-cz-a4-editor {
  margin-bottom: 16px;
}

.ky-cz-layout-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  padding: 18px;
  background: rgba(245, 247, 250, 0.96);
}

.ky-cz-wrap.is-layout-open .ky-cz-layout-overlay {
  display: block;
}

.ky-cz-layout-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
}

.ky-cz-layout-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.94);
}

.ky-cz-layout-bar h3 {
  margin: 0;
}

.ky-cz-layout-bar p {
  margin: 4px 0 0;
  color: rgba(31, 31, 33, 0.68);
  font-size: 13px;
}

.ky-cz-layout-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ky-cz-layout-workspace {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 18px;
  min-height: 0;
  padding: 18px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    #f7f8fb;
  background-size: 28px 28px;
}

.ky-cz-layout-panel,
.ky-cz-layout-preview {
  min-height: 0;
  margin: 0;
  overflow: auto;
}

.ky-cz-layout-preview {
  display: grid;
  align-items: start;
  justify-items: center;
  padding: 10px 18px 32px;
}

.ky-cz-layout-preview .ky-cz-a4-head {
  width: min(100%, 900px);
  justify-self: center;
}

.ky-cz-layout-preview .ky-cz-a4-page {
  width: min(88vh, 100%, 900px);
  max-height: none;
}

.ky-cz-layout-preview.is-preview-focus .ky-cz-a4-page {
  width: min(124vh, 132%, 1120px);
}

.ky-cz-a4-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ky-cz-a4-head p {
  margin: 0;
  color: rgba(31, 31, 33, 0.7);
  font-size: 13px;
}

.ky-cz-preview-mode {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.ky-cz-preview-mode button {
  border: 0;
  border-radius: 6px;
  padding: 6px 9px;
  background: transparent;
  color: rgba(31, 31, 33, 0.72);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
}

.ky-cz-preview-mode button.is-active {
  background: #1f1f21;
  color: #fff;
}

.ky-cz-preview-mode button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(38, 99, 235, 0.18);
}

.ky-cz-a4-warning {
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid rgba(180, 83, 9, 0.22);
  border-radius: 12px;
  background: rgba(255, 247, 237, 0.92);
  color: #8a3d0a;
  font-size: 13px;
  font-weight: 700;
}

.ky-cz-a4-page {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 210 / 297;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
}

.ky-cz-a4-pdf-canvas {
  /* Das Canvas ist die PDF-nahe Vorschau; alle HTML-Objekte darueber sind nur Bediengriffe. */
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ky-cz-a4-export-frame {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  border: 2px solid rgba(31, 31, 33, 0.52);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.9);
}

.ky-cz-a4-export-frame::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(31, 31, 33, 0.08) 0 1px, transparent 1px) 0 0 / 12px 12px,
    linear-gradient(180deg, rgba(31, 31, 33, 0.08) 0 1px, transparent 1px) 0 0 / 12px 12px;
  opacity: 0.18;
}

.ky-cz-a4-export-frame span {
  position: absolute;
  top: 6px;
  right: 8px;
  padding: 2px 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.92);
  color: rgba(31, 31, 33, 0.68);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
}

.ky-cz-layout-guide {
  position: absolute;
  z-index: 9000;
  pointer-events: none;
  background: rgba(14, 165, 233, 0.9);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.78);
}

.ky-cz-layout-guide-x {
  top: 0;
  bottom: 0;
  width: 1px;
}

.ky-cz-layout-guide-y {
  right: 0;
  left: 0;
  height: 1px;
}

.ky-cz-storage-status:empty {
  display: none;
}

.ky-cz-a4-zone {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  border: 1px dashed rgba(37, 99, 235, 0.22);
  background: rgba(239, 246, 255, 0.42);
}

.ky-cz-a4-zone span {
  position: absolute;
  top: 4px;
  left: 6px;
  color: rgba(37, 99, 235, 0.72);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.ky-cz-a4-zone img {
  max-width: min(var(--ky-img-size), 100%);
  max-height: min(var(--ky-img-size), 100%);
  object-fit: contain;
  opacity: var(--ky-img-opacity);
  filter: grayscale(var(--ky-img-bleach));
}

.ky-cz-a4-image {
  position: absolute;
  z-index: 30;
  min-width: 24px;
  min-height: 18px;
  overflow: visible;
  border: 1px solid rgba(31, 31, 33, 0.42);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.16);
  cursor: move;
  transform-origin: center center;
  user-select: none;
  touch-action: none;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.ky-cz-a4-image-clip {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
}

.ky-cz-a4-image:hover,
.ky-cz-a4-image[aria-pressed="true"],
.ky-cz-a4-page.is-editing-layout .ky-cz-a4-image[aria-pressed="true"] {
  border-color: rgba(31, 31, 33, 0.86);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.92), 0 0 0 3px rgba(31, 31, 33, 0.14);
}

.ky-cz-a4-image.is-near-edge {
  border-color: rgba(180, 83, 9, 0.8);
  box-shadow: 0 0 0 2px rgba(255, 247, 237, 0.94), 0 0 0 4px rgba(180, 83, 9, 0.14);
}

.ky-cz-a4-image-clip img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  opacity: var(--ky-img-opacity);
  filter: grayscale(var(--ky-img-bleach));
  pointer-events: none;
  transform: translate(var(--ky-crop-x), var(--ky-crop-y)) scale(var(--ky-crop-zoom));
  transform-origin: center;
}

.ky-cz-wrap .ky-cz-a4-resize {
  all: unset;
  box-sizing: border-box;
  position: absolute !important;
  z-index: 20;
  display: block !important;
  width: 20px !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 20px !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: transparent !important;
  font-size: 0;
  line-height: 0;
  box-shadow: none !important;
  opacity: 0;
  transform: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

.ky-cz-wrap .ky-cz-a4-resize::before,
.ky-cz-wrap .ky-cz-a4-resize::after {
  /* Sichtbar ist nur dieser kleine Eckwinkel; die Button-Flaeche selbst bleibt transparent. */
  position: absolute;
  content: "";
  background: #111;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9);
}

.ky-cz-wrap .ky-cz-a4-resize::before {
  width: 12px;
  height: 2px;
}

.ky-cz-wrap .ky-cz-a4-resize::after {
  width: 2px;
  height: 12px;
}

.ky-cz-wrap .ky-cz-a4-resize-nw {
  top: -1px !important;
  right: auto !important;
  bottom: auto !important;
  left: -1px !important;
  cursor: nwse-resize;
}

.ky-cz-wrap .ky-cz-a4-resize-nw::before,
.ky-cz-wrap .ky-cz-a4-resize-nw::after {
  top: 0;
  left: 0;
}

.ky-cz-wrap .ky-cz-a4-resize-ne {
  top: -1px !important;
  right: -1px !important;
  bottom: auto !important;
  left: auto !important;
  cursor: nesw-resize;
}

.ky-cz-wrap .ky-cz-a4-resize-ne::before,
.ky-cz-wrap .ky-cz-a4-resize-ne::after {
  top: 0;
  right: 0;
}

.ky-cz-wrap .ky-cz-a4-resize-sw {
  top: auto !important;
  right: auto !important;
  bottom: -1px !important;
  left: -1px !important;
  cursor: nesw-resize;
}

.ky-cz-wrap .ky-cz-a4-resize-sw::before,
.ky-cz-wrap .ky-cz-a4-resize-sw::after {
  bottom: 0;
  left: 0;
}

.ky-cz-wrap .ky-cz-a4-resize-se {
  top: auto !important;
  right: -1px !important;
  bottom: -1px !important;
  left: auto !important;
  cursor: nwse-resize;
}

.ky-cz-wrap .ky-cz-a4-resize-se::before,
.ky-cz-wrap .ky-cz-a4-resize-se::after {
  right: 0;
  bottom: 0;
}

.ky-cz-wrap .ky-cz-a4-resize:hover,
.ky-cz-wrap .ky-cz-a4-resize:focus-visible {
  outline: none;
}

.ky-cz-wrap .ky-cz-a4-image[aria-pressed="true"] .ky-cz-a4-resize,
.ky-cz-wrap .ky-cz-a4-image:hover .ky-cz-a4-resize {
  opacity: 1;
}

.ky-cz-wrap .ky-cz-a4-rotate {
  all: unset;
  box-sizing: border-box;
  position: absolute;
  left: 50%;
  bottom: -44px;
  z-index: 30;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid #111;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78) !important;
  color: #111 !important;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.14);
  cursor: grab;
  opacity: 0;
  transform: translateX(-50%);
  appearance: none;
  -webkit-appearance: none;
}

.ky-cz-wrap .ky-cz-a4-rotate:hover,
.ky-cz-wrap .ky-cz-a4-rotate:focus-visible {
  background: rgba(255, 255, 255, 0.94) !important;
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 31, 33, 0.16), 0 2px 10px rgba(15, 23, 42, 0.2);
}

.ky-cz-a4-image[aria-pressed="true"] .ky-cz-a4-rotate,
.ky-cz-a4-image:hover .ky-cz-a4-rotate,
.ky-cz-a4-table-preview.is-active .ky-cz-a4-rotate,
.ky-cz-a4-table-preview:hover .ky-cz-a4-rotate {
  opacity: 1;
}

.ky-cz-a4-zone-top {
  top: 8px;
  right: 8px;
  left: 8px;
  height: 18%;
}

.ky-cz-a4-zone-bottom {
  right: 8px;
  bottom: 8px;
  left: 8px;
  height: 14%;
}

.ky-cz-a4-zone-left {
  top: 26%;
  bottom: 18%;
  left: 8px;
  width: 18%;
  flex-direction: column;
}

.ky-cz-a4-zone-right {
  top: 26%;
  right: 8px;
  bottom: 18%;
  width: 18%;
  flex-direction: column;
}

.ky-cz-a4-table-preview {
  position: absolute;
  top: 16%;
  right: 8.6%;
  left: 8.6%;
  height: 72%;
  z-index: 5000;
  display: flex;
  flex-direction: column;
  gap: calc(4px * var(--ky-table-density, 1));
  padding: calc(9px * var(--ky-table-density, 1));
  border-radius: 6px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.82);
  cursor: move;
  transform-origin: center center;
  user-select: none;
  touch-action: none;
}

.ky-cz-a4-page.has-pdf-canvas .ky-cz-a4-table-preview,
.ky-cz-a4-page.has-pdf-canvas .ky-cz-a4-image {
  /* Das Canvas zeichnet die finale PDF-nahe Ausgabe; diese Ebene bleibt nur fuer Drag, Auswahl und Handles sichtbar. */
  background: transparent;
}

.ky-cz-a4-page.has-pdf-canvas .ky-cz-a4-table-preview > :not(.ky-cz-a4-table-resize):not(.ky-cz-a4-rotate),
.ky-cz-a4-page.has-pdf-canvas .ky-cz-a4-image-clip img {
  opacity: 0;
}

.ky-cz-a4-table-preview.is-active,
.ky-cz-a4-table-preview:hover {
  border-color: rgba(31, 31, 33, 0.86);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.92), 0 0 0 3px rgba(31, 31, 33, 0.12);
}

.ky-cz-a4-table-title {
  overflow: hidden;
  color: #1f1f21;
  font-weight: 800;
  font-size: var(--ky-table-title-size);
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ky-cz-a4-table-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 9px;
  padding: 2px 0 4px;
  color: rgba(31, 31, 33, 0.86);
  line-height: 1.18;
}

.ky-cz-a4-table-meta span {
  color: rgba(31, 31, 33, 0.84);
  font-size: var(--ky-table-meta-size);
  font-weight: 700;
}

.ky-cz-a4-table-grid {
  display: grid;
  min-height: 0;
  margin-top: var(--ky-table-meta-gap);
  overflow: hidden;
  border-radius: 3px;
  font-size: var(--ky-table-row-size);
  line-height: 1.18;
}

.ky-cz-a4-table-row {
  display: grid;
  grid-template-columns: minmax(36px, 0.92fr) minmax(36px, 0.82fr) minmax(86px, 2.2fr) minmax(28px, 0.58fr);
  gap: 4px;
  min-height: calc(13px * var(--ky-table-density, 1));
  padding: calc(3px * var(--ky-table-density, 1)) calc(5px * var(--ky-table-density, 1));
  align-items: center;
  color: rgba(31, 31, 33, 0.78);
}

.ky-cz-a4-table-row:nth-child(odd):not(.ky-cz-a4-table-row-head) {
  background: rgba(15, 23, 42, 0.04);
}

.ky-cz-a4-table-row-head {
  min-height: calc(16px * var(--ky-table-density, 1));
  background: #2f86bd;
  color: #fff;
  font-weight: 800;
}

.ky-cz-a4-meta-guide {
  position: absolute;
  z-index: 9500;
  pointer-events: none;
  transform-origin: center center;
  border: 1px dashed rgba(180, 83, 9, 0.82);
  background: rgba(255, 247, 237, 0.18);
}

.ky-cz-a4-meta-guide span {
  position: absolute;
  top: -18px;
  left: 0;
  padding: 2px 5px;
  border-radius: 3px;
  background: rgba(255, 247, 237, 0.96);
  color: #8a3d0a;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
}

.ky-cz-a4-table-row span {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ky-cz-a4-table-overflow {
  padding: 3px 5px;
  color: rgba(31, 31, 33, 0.58);
  font-size: var(--ky-table-meta-size);
  font-weight: 700;
}

.ky-cz-wrap .ky-cz-a4-table-resize {
  all: unset;
  box-sizing: border-box;
  position: absolute;
  right: -13px;
  top: 50%;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 2px solid #111;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78) !important;
  color: #111 !important;
  font-size: 21px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.14);
  cursor: ew-resize;
  opacity: 0;
  transform: translateY(-50%);
  appearance: none;
  -webkit-appearance: none;
}

.ky-cz-a4-table-preview.is-active .ky-cz-a4-table-resize,
.ky-cz-a4-table-preview:hover .ky-cz-a4-table-resize {
  opacity: 1;
}

.ky-cz-wrap .ky-cz-a4-table-resize:hover,
.ky-cz-wrap .ky-cz-a4-table-resize:focus-visible {
  background: rgba(255, 255, 255, 0.94) !important;
  color: #000 !important;
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 31, 33, 0.16), 0 2px 10px rgba(15, 23, 42, 0.2);
}

.ky-cz-storage h4 {
  margin: 0 0 10px;
  font-size: 16px;
}

.ky-cz-storage .ky-cz-btn {
  margin-top: 12px;
}

.ky-cz-storage-status {
  min-height: 20px;
  margin: 10px 0 0;
  color: #25643b;
  font-size: 13px;
  font-weight: 600;
}

.ky-cz-storage-status.is-error {
  color: #b00020;
}

.ky-cz-summary {
  font-size: 14px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 246, 248, 0.92));
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.ky-cz-summary > div + div {
  margin-top: 8px;
}

.ky-cz-tablewrap {
  display: none;
}

.ky-cz-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.ky-cz-table th,
.ky-cz-table td {
  border-bottom: 1px solid #eee;
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

.ky-cz-badge {
  display: inline-block;
  min-width: 54px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  color: rgba(31, 31, 33, 0.78);
  text-align: center;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.ky-cz-format {
  display: flex;
  gap: 10px;
  margin: 10px 0 14px;
  flex-wrap: wrap;
}

.ky-cz-format-btn {
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  font-weight: 700;
  appearance: none;
  -webkit-appearance: none;
}

.ky-cz-format-btn.is-active {
  border-color: rgba(17, 17, 17, 0.18);
  background: linear-gradient(180deg, #1c1c1e, #09090b);
  color: #fff;
}

.ky-cz-divisions {
  margin-top: 10px;
  padding: 12px;
  border: 1px dashed rgba(15, 23, 42, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.45);
}

.ky-cz-div-row {
  margin: 10px 0 14px;
}

.ky-cz-div-grid,
.ky-cz-adv-labels {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 10px;
  margin-top: 6px;
}

.ky-cz-div-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ky-cz-div-head span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ky-cz-add-division {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100% !important;
  height: 18px !important;
  margin: 2px 0 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: inherit;
  cursor: pointer;
  line-height: 1 !important;
  overflow: visible;
  appearance: none;
  -webkit-appearance: none;
}

.ky-cz-add-division-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  transition: transform 160ms ease, background 160ms ease;
}

.ky-cz-add-division:hover .ky-cz-add-division-icon {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.ky-cz-add-division:focus-visible {
  outline: none;
}

.ky-cz-add-division:focus-visible .ky-cz-add-division-icon {
  background: #1d4ed8;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
  transform: translateY(-1px);
}

.ky-cz-editor {
  margin-top: 18px;
  max-width: 100%;
  min-width: 0;
}

.ky-cz-editor-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 2px 2px 8px;
}

.ky-cz-editor-head p {
  margin: 0;
  font-size: 13px;
  opacity: 0.78;
}

.ky-cz-editor-subtitle {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.6;
  margin-bottom: 8px;
}

.ky-cz-floating {
  margin-bottom: 14px;
}

.ky-cz-floating-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.ky-cz-floating-item + .ky-cz-floating-item {
  margin-top: 8px;
}

.ky-cz-slots {
  display: grid;
  gap: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 247, 249, 0.94));
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
  overflow: hidden;
}

.ky-cz-slot-head {
  display: grid;
  grid-template-columns: minmax(94px, 0.88fr) 96px minmax(144px, 1.82fr) 68px 28px;
  gap: 12px;
  padding: 14px 14px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(31, 31, 33, 0.48);
  background: rgba(255, 255, 255, 0.72);
}

.ky-cz-slot-head span:nth-child(2) {
  justify-self: start;
}

.ky-cz-slot {
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.72);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.ky-cz-slot.is-drop-target {
  box-shadow: inset 0 0 0 2px rgba(17, 17, 17, 0.08);
}

.ky-cz-slot.is-dragging {
  opacity: 0.55;
}

.ky-cz-slot.is-open {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(251, 251, 252, 0.98));
}

.ky-cz-slot-row {
  display: grid;
  grid-template-columns: minmax(94px, 0.88fr) 96px minmax(144px, 1.82fr) 68px 28px;
  gap: 12px;
  align-items: center;
  padding: 14px;
}

.ky-cz-slot-time,
.ky-cz-slot-title,
.ky-cz-slot-duration {
  min-width: 0;
  font-size: 12px;
  color: rgba(31, 31, 33, 0.76);
}

.ky-cz-slot-time,
.ky-cz-slot-duration {
  word-break: break-word;
}

.ky-cz-slot-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ky-cz-slot-duration {
  text-align: left;
}

.ky-cz-slot-type,
.ky-cz-slot-grip {
  display: flex;
  align-items: center;
}

.ky-cz-slot-type {
  justify-content: flex-start;
  justify-self: start;
}

.ky-cz-slot-grip {
  justify-content: flex-end;
}

.ky-cz-type-pill {
  display: inline-flex !important;
  align-items: center;
  justify-content: flex-start;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 6px;
  width: auto;
  max-width: fit-content;
  padding: 0;
  border-radius: 0;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: pointer;
  color: rgba(31, 31, 33, 0.78) !important;
  white-space: nowrap;
  transition: transform 160ms ease;
  appearance: none;
  -webkit-appearance: none;
}

.ky-cz-type-pill:hover,
.ky-cz-type-pill:focus-visible {
  transform: translateY(-1px);
}

.ky-cz-type-pill:hover .ky-cz-badge,
.ky-cz-type-pill:focus-visible .ky-cz-badge {
  background: rgba(15, 23, 42, 0.08);
  border-color: rgba(15, 23, 42, 0.1);
}

.ky-cz-type-pill:hover .ky-cz-pill-arrow,
.ky-cz-type-pill:focus-visible .ky-cz-pill-arrow {
  background: rgba(15, 23, 42, 0.1);
  color: rgba(31, 31, 33, 0.72);
}

.ky-cz-pill-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  color: rgba(31, 31, 33, 0.5);
  background: rgba(15, 23, 42, 0.05);
  font-size: 12px;
  line-height: 1;
}

.ky-cz-drag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  cursor: grab;
  font-weight: 700;
  color: rgba(31, 31, 33, 0.52);
}

.ky-cz-mini-btn {
  border-radius: 999px;
  padding: 7px 11px;
  cursor: pointer;
  font-size: 12px;
}

.ky-cz-slot-panel {
  display: none;
  padding: 0 14px 14px;
  background: rgba(248, 248, 250, 0.84);
}

.ky-cz-slot.is-open .ky-cz-slot-panel {
  display: block;
}

.ky-cz-slot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.ky-cz-slot-grid label,
.ky-cz-slot-label {
  font-size: 12px;
}

.ky-cz-slot-grid input,
.ky-cz-slot-grid select,
.ky-cz-slot-label input {
  padding: 8px 10px;
  min-height: 42px;
  font-size: 12px;
}

.ky-cz-slot-label {
  margin-top: 8px;
}

.ky-cz-slot-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

@media (max-width: 1100px) {
  .ky-cz-slot-head,
  .ky-cz-slot-row {
    grid-template-columns: minmax(88px, 0.82fr) 90px minmax(122px, 1.52fr) 62px 24px;
  }
}

@media (max-width: 780px) {
  .ky-cz-wrap {
    margin: 16px auto;
    padding: 0 10px;
  }

  .ky-cz-card {
    border-radius: 20px;
    padding: 14px;
  }

  .ky-cz-slot-head {
    display: none;
  }

  .ky-cz-slots {
    border-radius: 20px;
  }

  .ky-cz-slot-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "time duration"
      "type grip"
      "title title";
    gap: 8px 10px;
    align-items: start;
    padding: 12px;
  }

  .ky-cz-slot-time {
    grid-area: time;
  }

  .ky-cz-slot-duration {
    grid-area: duration;
    justify-self: end;
    text-align: right;
  }

  .ky-cz-slot-type {
    grid-area: type;
    justify-self: start;
  }

  .ky-cz-slot-grip {
    grid-area: grip;
    justify-self: end;
  }

  .ky-cz-slot-title {
    grid-area: title;
    white-space: normal;
  }

  .ky-cz-type-pill {
    width: auto;
  }

  .ky-cz-slot-row {
    min-width: 0;
  }

  .ky-cz-slot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ky-cz-slot-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 520px) {
  .ky-cz-grid {
    gap: 12px;
  }

  .ky-cz-row,
  .ky-cz-slot-grid,
  .ky-cz-div-grid,
  .ky-cz-adv-labels {
    grid-template-columns: 1fr;
  }

  .ky-cz-div-head,
  .ky-cz-floating-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .ky-cz-slot-row {
    grid-template-columns: 1fr;
    grid-template-areas:
      "time"
      "type"
      "title"
      "duration"
      "grip";
  }

  .ky-cz-slot-duration,
  .ky-cz-slot-grip {
    justify-self: start;
    text-align: left;
  }

  .ky-cz-slot-panel {
    padding: 0 12px 12px;
  }
}
