/* NO COMMENTS NO DEBUGGING - CODE ONLY */

.editable-row {
  position: relative;
  margin-bottom: 8px;
  text-align: center;
}

.editable-row:last-child { margin-bottom: 0; }

.ef-action {
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}

.ef-action button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}

.ef-action button:hover { background: var(--sunflower-soft); color: var(--sunflower-hover); }
.ef-action button svg { width: 14px; height: 14px; }
.ef-action .btn-confirm { color: var(--sunflower-hover); background: var(--sunflower-soft); }
.ef-action .btn-confirm:hover { background: rgba(251,191,36,0.25); }

.ef-counter {
  position: absolute;
  left: 4px;
  top: 100%;
  margin-top: -2px;
  font-size: 10px;
  color: var(--text-muted);
  visibility: hidden;
  pointer-events: none;
}

.editable-row.editing .ef-counter { visibility: visible; }
.ef-counter.near-limit { color: var(--danger); }

.editable-row h1 { padding: 4px 36px; }
.editable-row p { padding: 4px 36px; }

.editable-row input,
.editable-row textarea {
  display: none;
  width: 100%;
  padding: 4px 36px;
  font-family: var(--font-stack);
  border: none;
  border-radius: 8px;
  background: #f4f4f5;
  color: var(--text-primary);
  outline: none;
  text-align: center;
}

.editable-row .title-input { font-size: 22px; font-weight: 700; line-height: 1.3; resize: none; overflow: hidden; }
.editable-row .desc-input { font-size: 14px; color: var(--text-secondary); line-height: 1.5; resize: none; overflow: hidden; }
.editable-row.editing h1, .editable-row.editing p { display: none; }
.editable-row.editing input, .editable-row.editing textarea { display: block; }

.group-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.group-header .group-label { margin-bottom: 0; }

.group-controls { display: flex; gap: 1px; }

.group-controls button {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border: none; border-radius: 6px;
  cursor: pointer; font-size: 12px; font-family: var(--font-stack);
  background: transparent; color: var(--text-muted);
  transition: all .12s; -webkit-tap-highlight-color: transparent;
}

.group-controls button:hover { background: #f0f0f2; color: var(--text-secondary); }
.group-controls button.btn-disabled { opacity: 0.25; cursor: default; }
.group-controls button.btn-disabled:hover { background: transparent; color: var(--text-muted); }

.link-item.link-editing { padding: 10px 12px; }
.link-item.link-preview { cursor: pointer; }
.link-item.link-preview:hover { background: #f0f0f2; border-color: #dcdce0; }
.link-item.link-preview:active { transform: scale(.985); }
.link-item.link-valid { border-color: #bbf7d0; }
.link-item.link-invalid { border-color: #fecaca; background: #fef2f2; }

.link-input-wrap { flex: 1; min-width: 0; }

.link-input-wrap input {
  width: 100%; padding: 7px 10px; font-size: 13px;
  font-family: var(--font-stack); border: 1px solid #e5e7eb;
  border-radius: 8px; background: #fff; color: var(--text-primary);
  outline: none; transition: border-color .15s;
}

.link-input-wrap input:focus { border-color: var(--sunflower); }
.link-input-wrap input::placeholder { color: var(--text-muted); }

.link-controls { display: flex; align-items: center; gap: 1px; flex-shrink: 0; }
.link-controls-preview { margin-left: auto; }

.link-controls button {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border: none; border-radius: 6px;
  cursor: pointer; font-size: 13px; font-family: var(--font-stack);
  background: transparent; color: var(--text-muted);
  transition: all .12s; -webkit-tap-highlight-color: transparent;
}

.link-controls button:hover { background: #f0f0f2; color: var(--text-secondary); }
.link-controls button.btn-disabled { opacity: 0.25; cursor: default; }
.link-controls button.btn-disabled:hover { background: transparent; color: var(--text-muted); }
.link-controls .btn-delete:hover { background: var(--danger-soft); color: var(--danger); }
.link-controls .btn-link-confirm { color: var(--sunflower-hover); }
.link-controls .btn-link-confirm:hover { background: var(--sunflower-soft); }
.link-controls .btn-link-confirm svg, .link-controls .btn-link-edit svg { width: 14px; height: 14px; }
.link-controls .btn-link-edit { color: var(--text-muted); }
.link-controls .btn-link-edit:hover { color: var(--sunflower-hover); background: var(--sunflower-soft); }

.add-link-area { margin-top: 24px; }

.btn-add-link {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px 16px; font-size: 14px; font-weight: 600;
  font-family: var(--font-stack); color: var(--text-primary);
  background: var(--sunflower); border: none; border-radius: var(--radius-btn);
  cursor: pointer; transition: background .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}

.btn-add-link:hover { background: var(--sunflower-hover); }
.btn-add-link:active { transform: scale(.985); }
.btn-add-link svg { width: 18px; height: 18px; }

.constructor-header {
  width: 100%; max-width: 480px;
  display: flex; justify-content: flex-end; margin-bottom: 12px;
}

.btn-settings {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; font-size: 12px; font-weight: 500;
  font-family: var(--font-stack); color: rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; cursor: pointer; transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}

.btn-settings:hover { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.7); }
.btn-settings:active { transform: scale(.97); }
.btn-settings svg { width: 15px; height: 15px; }

.add-menu {
  display: none; margin-top: 12px; background: #fafafa;
  border: 1px solid #ebebed; border-radius: var(--radius-card);
  padding: 16px; animation: menuAppear .25s cubic-bezier(.16,1,.3,1) both;
}

.add-menu.active { display: block; }

@keyframes menuAppear {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.add-menu-category { margin-bottom: 16px; }
.add-menu-category:last-child { margin-bottom: 0; }

.add-menu-category-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted);
  margin-bottom: 8px; padding-left: 2px;
}

.add-menu-grid { display: flex; flex-wrap: wrap; gap: 6px; }

.add-menu-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; font-size: 12px; font-weight: 500;
  font-family: var(--font-stack); color: var(--text-primary);
  background: #fff; border: 1px solid #e5e7eb; border-radius: 8px;
  cursor: pointer; transition: all .12s; -webkit-tap-highlight-color: transparent;
}

.add-menu-item:hover { border-color: var(--sunflower); background: var(--sunflower-soft); }
.add-menu-item:active { transform: scale(.97); }
.add-menu-item img { width: 16px; height: 16px; object-fit: contain; }

.generate-area { margin-top: 24px; }

.btn-generate {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 16px; font-size: 15px; font-weight: 700;
  font-family: var(--font-stack); color: var(--text-primary);
  background: var(--sunflower); border: none; border-radius: var(--radius-btn);
  cursor: pointer; transition: background .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}

.btn-generate:hover { background: var(--sunflower-hover); }
.btn-generate:active { transform: scale(.985); }

.result-section {
  display: none; margin-top: 24px;
  animation: menuAppear .3s cubic-bezier(.16,1,.3,1) both;
}

.result-section.active { display: block; }

.result-url-box {
  background: #f4f4f5; border: 1px solid #ebebed;
  border-radius: var(--radius-btn); padding: 14px 16px;
  font-size: 13px; font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  color: var(--text-primary); word-break: break-all;
  line-height: 1.5; margin-bottom: 12px; text-align: center;
}

.result-actions { display: flex; gap: 8px; }

.result-actions button {
  flex: 1; padding: 14px 16px; border-radius: var(--radius-btn);
  font-size: 14px; font-weight: 600; font-family: var(--font-stack);
  cursor: pointer; border: none;
  transition: background .15s, transform .1s; -webkit-tap-highlight-color: transparent;
}

.result-actions button:active { transform: scale(.97); }
.btn-copy-url { background: var(--sunflower); color: var(--text-primary); }
.btn-copy-url:hover { background: var(--sunflower-hover); }
.btn-back-edit { background: #f0f0f2; color: var(--text-secondary); }
.btn-back-edit:hover { background: #e5e5e8; }

.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.5); backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center; justify-content: center; padding: 24px 16px;
}

.modal-overlay.active { display: flex; }

.modal-card {
  width: 100%; max-width: 400px; background: #fff;
  border-radius: 16px; padding: 24px 20px 20px;
  animation: modalIn .25s cubic-bezier(.16,1,.3,1) both;
}

.modal-sm { max-width: 320px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 16px; text-align: center; }
.modal-body { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 20px; }

.modal-footer { display: flex; gap: 8px; }

.modal-btn-primary, .modal-btn-secondary {
  flex: 1; padding: 12px 16px; border-radius: var(--radius-btn);
  font-size: 14px; font-weight: 600; font-family: var(--font-stack);
  cursor: pointer; border: none;
  transition: background .15s, transform .1s; -webkit-tap-highlight-color: transparent;
}

.modal-btn-primary { background: var(--sunflower); color: var(--text-primary); }
.modal-btn-primary:hover { background: var(--sunflower-hover); }
.modal-btn-secondary { background: #f0f0f2; color: var(--text-secondary); }
.modal-btn-secondary:hover { background: #e5e5e8; }
.modal-btn-primary:active, .modal-btn-secondary:active { transform: scale(.97); }

.bg-section { margin-bottom: 16px; }
.bg-section:last-child { margin-bottom: 0; }

.bg-section-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 8px;
}

.bg-color-row { display: flex; gap: 12px; }

.bg-color-pick { display: flex; align-items: center; gap: 8px; flex: 1; }
.bg-color-label { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }

.color-swatch {
  width: 40px;
  height: 40px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
  transition: border-color .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.color-swatch:hover { border-color: #bbb; }
.color-swatch:active { transform: scale(.93); }

.bg-pattern-grid { display: flex; flex-wrap: wrap; gap: 8px; }

.bg-pattern-opt {
  width: 48px; height: 48px;
  border: 2px solid #e5e7eb; border-radius: 10px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  background: #f8f8f9;
  transition: border-color .15s; -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

.bg-pattern-opt:hover { border-color: #bbb; }
.bg-pattern-opt.active { border-color: var(--sunflower); border-width: 3px; }

.bg-pattern-opt .pat-preview {
  width: 100%; height: 100%;
  background-repeat: repeat;
  background-size: 14px 14px;
}

.bg-pattern-opt .pat-none {
  font-size: 11px; color: var(--text-muted); font-weight: 500;
}

#colorPickerModal .modal-card { max-width: 300px; }

.cp-preview {
  width: 100%; height: 48px;
  border-radius: 10px; margin-bottom: 14px;
  border: 1px solid #e5e7eb;
}

.cp-slider-wrap { margin-bottom: 10px; }

.cp-range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 12px;
  border-radius: 6px; outline: none;
  cursor: pointer; border: none;
  background: #ddd;
  direction: ltr;
}

.cp-range::-webkit-slider-runnable-track {
  height: 12px; border-radius: 6px;
  background: inherit;
}

.cp-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%; background: #fff;
  border: 2px solid rgba(0,0,0,.2); cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  margin-top: -4px;
}

.cp-range::-moz-range-track {
  height: 12px; border-radius: 6px;
  background: inherit; border: none;
}

.cp-range::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%; background: #fff;
  border: 2px solid rgba(0,0,0,.2); cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
}

.cp-hue {
  background: linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000) !important;
}

.cp-hex {
  width: 100%; padding: 8px 12px;
  font-size: 14px; font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  border: 1px solid #e5e7eb; border-radius: 8px;
  background: #fff; color: var(--text-primary);
  text-align: center; outline: none;
  margin-bottom: 12px;
}

.cp-hex:focus { border-color: var(--sunflower); }

.cp-swatches {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 16px;
}

.cp-swatch {
  width: 28px; height: 28px;
  border-radius: 6px; border: 2px solid #e5e7eb;
  cursor: pointer; padding: 0;
  transition: border-color .12s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}

.cp-swatch:hover { border-color: #999; }
.cp-swatch:active { transform: scale(.9); }

.result-debug-box {
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-secondary);
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  background: #f4f4f5;
  border: 1px solid #ebebed;
  border-radius: var(--radius-btn);
  padding: 12px 14px;
  white-space: pre-wrap;
  word-break: break-all;
  text-align: left;
  margin-bottom: 10px;
}

.constructor-controls-hidden .link-controls,
.constructor-controls-hidden .ef-action,
.constructor-controls-hidden .add-link-area,
.constructor-controls-hidden .generate-area,
.constructor-controls-hidden .link-input-wrap,
.constructor-controls-hidden .group-controls {
  display: none !important;
}

.constructor-header.hidden { display: none !important; }