/* ============ ACTIVITY EDITOR ============ */

/* Modal wrapper */
.ade-modal {
  /* hereda de .ad-modal */
}

/* Progress bar */
.ade-progress {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 24px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
}
.ade-progress-track {
  flex: 1;
  height: 6px;
  background: color-mix(in oklab, var(--fg) 10%, transparent);
  border-radius: 3px;
  overflow: hidden;
}
.theme-cancha .ade-progress-track { background: rgba(255,255,255,0.08); }
.ade-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.25s ease-out;
}
.ade-progress-text {
  display: flex; align-items: baseline; gap: 6px;
  white-space: nowrap;
}
.ade-progress-num {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--fg);
}
.ade-progress-num small {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-muted);
}
.ade-progress-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
}

/* HERO editable */
.ade-hero {
  min-height: auto;
  padding-bottom: 32px;
}
.ade-hero .ad-hero-content {
  gap: 14px;
  padding-right: 60px;
}
.ade-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  align-self: flex-start;
  position: relative;
  z-index: 3;
}
.theme-cancha .ade-mode-badge { background: var(--accent); color: var(--accent-fg); }
.theme-playful .ade-mode-badge { background: var(--accent); color: var(--accent-fg); }
.ade-dot-pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: adePulse 1.6s ease-in-out infinite;
}
@keyframes adePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.ade-field-inline {
  display: flex; flex-direction: column;
  gap: 5px;
  position: relative;
  z-index: 2;
}
.ade-inline-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
  font-weight: 600;
}

/* Category picker */
.ade-cat-picker {
  display: inline-flex;
  background: rgba(0,0,0,0.3);
  padding: 3px;
  border-radius: var(--radius);
  gap: 2px;
  align-self: flex-start;
}
.theme-cuaderno .ade-cat-picker { background: rgba(255,255,255,0.6); border: 1px solid var(--line); }
.ade-cat-opt {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-dim);
  transition: all 0.15s;
}
.ade-cat-opt:hover { color: var(--fg); }
.ade-cat-opt.on {
  background: var(--accent);
  color: var(--accent-fg);
}
.theme-cuaderno .ade-cat-opt.on { background: var(--accent); color: #fff; }

/* Hero letter preview */
.ade-hero-letter-preview {
  position: absolute;
  right: -20px;
  bottom: -60px;
  font-family: var(--font-display);
  font-size: 240px;
  font-weight: 800;
  letter-spacing: -0.06em;
  color: var(--fg);
  opacity: 0.09;
  line-height: 1;
  pointer-events: none;
  z-index: 1;
}
.theme-cancha .ade-hero-letter-preview { color: var(--accent); opacity: 0.12; }
.theme-playful .ade-hero-letter-preview { color: var(--accent); opacity: 0.14; }

/* Title input */
.ade-title-input {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--fg);
  background: transparent;
  border: none;
  outline: none;
  border-bottom: 2px dashed var(--line-strong);
  padding: 4px 0;
  width: 100%;
  position: relative;
  z-index: 2;
}
.ade-title-input:focus { border-bottom-color: var(--accent); }
.ade-title-input::placeholder {
  color: var(--fg-muted);
  font-style: italic;
}
.theme-cancha .ade-title-input { text-transform: uppercase; letter-spacing: -0.01em; }
.theme-cuaderno .ade-title-input { font-style: italic; font-weight: 500; }

/* Hero row */
.ade-hero-row {
  display: flex;
  gap: 32px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.ade-inline-input {
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  color: var(--fg);
  font-size: 13px;
  font-family: var(--font-body);
  outline: none;
  min-width: 240px;
}
.theme-cuaderno .ade-inline-input { background: rgba(255,255,255,0.7); }
.ade-inline-input:focus { border-color: var(--accent); }
.ade-inline-input.full { width: 100%; min-width: 0; }
.ade-inline-input::placeholder { color: var(--fg-muted); }

/* Color picker */
.ade-color-picker {
  display: inline-flex;
  gap: 6px;
  align-self: flex-start;
  padding: 4px;
}
.ade-color-swatch {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s;
}
.ade-color-swatch:hover { transform: scale(1.1); }
.ade-color-swatch.on {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--fg);
}
.theme-cuaderno .ade-color-swatch.on { box-shadow: 0 0 0 2px var(--accent); }
.ade-color-swatch.coral { background: var(--coral); }
.ade-color-swatch.azul { background: var(--azul); }
.ade-color-swatch.verde { background: var(--verde); }
.ade-color-swatch.amarillo { background: var(--amarillo); }

/* STATS BAR editable */
.ade-stats-bar { }
.ade-num-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
}
.ade-num-input {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
  background: transparent;
  border: none;
  border-bottom: 2px dashed var(--line-strong);
  outline: none;
  width: 48px;
  text-align: left;
  padding: 0 0 2px;
  line-height: 1;
  -moz-appearance: textfield;
}
.ade-num-input.xs { width: 34px; text-align: center; }
.ade-num-input:focus { border-bottom-color: var(--accent); }
.ade-num-input::-webkit-outer-spin-button,
.ade-num-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ade-num-sep {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--fg-muted);
  padding: 0 2px;
}

.ade-select-inline select {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  background: transparent;
  border: none;
  border-bottom: 2px dashed var(--line-strong);
  padding: 2px 22px 2px 0;
  outline: none;
  cursor: pointer;
  text-transform: capitalize;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'><path d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right center;
}
.ade-select-inline select:focus { border-bottom-color: var(--accent); }

.ade-intensity-picker {
  display: inline-flex;
  gap: 4px;
  padding: 2px 0;
}
.ade-intensity-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--fg-muted);
  background: transparent;
  transition: all 0.15s;
  cursor: pointer;
}
.ade-intensity-dot:hover { border-color: var(--fg); }
.ade-intensity-dot.on {
  background: var(--accent);
  border-color: var(--accent);
}

/* BODY */
.ade-body { }
.ade-side {
  gap: 22px;
}
.ade-section { }

/* Textareas & inputs */
.ade-textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  resize: vertical;
  outline: none;
  min-height: 60px;
  transition: border-color 0.15s;
}
.ade-textarea:focus { border-color: var(--accent); }
.ade-textarea::placeholder { color: var(--fg-muted); font-style: italic; }

.ade-lede-input {
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--bg-elev);
}
.theme-cuaderno .ade-lede-input { font-style: italic; }

/* Steps editable */
.ade-steps { gap: 8px; }
.ade-step {
  align-items: center;
}
.ade-step-input {
  flex: 1;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 12px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.ade-step-input:focus { border-color: var(--accent); }
.ade-step-input::placeholder { color: var(--fg-muted); font-style: italic; }

.ade-step { grid-template-columns: 32px 1fr 30px; }
.ade-rule { grid-template-columns: 20px 1fr 30px; align-items: center; }

.ade-remove {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: transparent;
  color: var(--fg-muted);
  font-size: 18px;
  line-height: 1;
  display: grid; place-items: center;
  transition: all 0.15s;
}
.ade-remove:hover {
  background: var(--coral);
  color: #fff;
}
.ade-remove.sm {
  width: 22px; height: 22px;
  font-size: 14px;
}

.ade-add-btn {
  margin-top: 10px;
  padding: 8px 14px;
  background: transparent;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: all 0.15s;
}
.ade-add-btn:hover {
  color: var(--fg);
  border-color: var(--fg-muted);
  background: var(--bg-elev);
}
.ade-add-btn.small { padding: 6px 10px; font-size: 10px; margin-top: 6px; }

/* Variants editable */
.ade-variant-input {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  min-height: 68px;
  transition: border-color 0.15s;
}
.ade-variant-input:focus { border-color: var(--accent); }
.ade-variant-input::placeholder { color: var(--fg-muted); font-style: italic; }

/* Adaptations editable */
.ade-adapt { align-items: flex-start; grid-template-columns: 28px 1fr 30px; }
.ade-adapt-input {
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  min-height: 44px;
  transition: all 0.15s;
}
.ade-adapt-input:focus {
  border-color: var(--accent);
  background: var(--bg-panel);
}
.ade-adapt-input::placeholder { color: var(--fg-muted); font-style: italic; }

/* Material editable */
.ade-material-list {
  list-style: none;
  display: flex; flex-direction: column;
  gap: 6px;
}
.ade-material-item {
  display: grid;
  grid-template-columns: 1fr auto 22px;
  gap: 8px;
  align-items: center;
}
.ade-material-name-input {
  padding: 7px 10px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-size: 13px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.15s;
}
.ade-material-name-input:focus { border-color: var(--accent); }
.ade-material-qty-wrap {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.ade-x {
  font-family: var(--font-mono);
  color: var(--fg-muted);
  font-size: 12px;
}
.ade-material-qty-input {
  width: 44px;
  padding: 7px 6px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  outline: none;
  text-align: center;
  -moz-appearance: textfield;
}
.ade-material-qty-input::-webkit-outer-spin-button,
.ade-material-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ade-material-qty-input:focus { border-color: var(--accent); }

/* Goals picker */
.ade-goal-picker {
  display: flex; flex-wrap: wrap;
  gap: 6px;
}
.ade-goal-chip {
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  color: var(--fg-dim);
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ade-goal-chip:hover { color: var(--fg); border-color: var(--fg-muted); }
.ade-goal-chip.on {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
  font-weight: 600;
}
.theme-cuaderno .ade-goal-chip.on { background: var(--accent); color: #fff; }
.ade-check { font-size: 10px; font-weight: 700; }

/* Tip card */
.ade-tip-card {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  padding: 12px 14px;
  background: color-mix(in oklab, var(--amarillo) 12%, var(--bg-panel));
  border: 1px solid color-mix(in oklab, var(--amarillo) 30%, var(--line));
  border-radius: var(--radius);
}
.ade-tip-icon {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--amarillo);
  color: #2b1e0e;
  display: grid; place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.ade-tip-title {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 3px;
}
.ade-tip-text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--fg-dim);
  text-wrap: pretty;
}

/* Field hint */
.ade-field-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  font-weight: 600;
}
.ade-field-hint.ok { color: var(--verde); }

/* Footer */
.ade-footer {
  gap: 16px;
}
.ade-footer-status {
  flex: 1;
  min-width: 0;
}
.ade-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.ade-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}
.ade-status.ok { color: var(--verde); }
.ade-status.ok .ade-status-dot {
  background: var(--verde);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--verde) 30%, transparent);
}
.ade-status.warn { color: var(--fg-muted); text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-weight: 500; font-size: 12px; }
.ade-status.warn .ade-status-dot { background: var(--amarillo); }

.btn.disabled,
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.4);
}
.btn:disabled:hover { background: var(--bg-panel); }
.btn-primary:disabled { background: var(--bg-elev); color: var(--fg-muted); border-color: var(--line-strong); }

/* Toast */
.ade-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  background: var(--fg);
  color: var(--bg);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  z-index: 200;
  animation: adeToastIn 0.3s ease-out;
}
.theme-cancha .ade-toast { background: var(--accent); color: var(--accent-fg); }
.ade-toast-icon {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--verde);
  color: #fff;
  display: grid; place-items: center;
  font-size: 12px;
  font-weight: 700;
}
@keyframes adeToastIn {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
