/* AMT Journal — formulario de operación (drawer). Prefijo .tf- */

.tf-form { display: flex; flex-direction: column; gap: 26px; }

/* cabecera de sección: etiqueta + hairline hasta el borde */
.tf-sec-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; color: var(--text-3); }
.tf-sec-head::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }

.tf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; align-items: start; }
.tf-span { grid-column: 1 / -1; }
.tf-opt { margin-left: 6px; font-weight: 400; color: var(--text-4); }
.tf-form .hint.tf-warn { color: var(--warn); }
.tf-form .select { text-overflow: ellipsis; }
.tf-none { font-size: 12.5px; line-height: 1.5; color: var(--text-3); }

/* segmentados a la altura de un input */
.tf-seg .seg {
  display: flex;
  height: 36px;
  padding: 3px;
  border-color: var(--line);
  border-radius: var(--r-md);
  background: var(--inset);
}
.tf-seg .seg button { flex: 1; height: 100%; padding: 0 6px; border-radius: 6px; font-size: 13px; }
.tf-seg .seg button .side { font-size: 13px; color: inherit; }
.tf-seg .seg button:not(.is-active) .side i { opacity: .45; }

.tf-link { font-size: 12px; font-weight: 500; color: var(--text-2); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.tf-link:hover { color: var(--text); }

/* ---------- panel de resultado en vivo ---------- */
.tf-live {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, .028), rgba(255, 255, 255, .006)), var(--bg-1);
  overflow: hidden;
}
.tf-live-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 16px 18px 15px; }
.tf-live-net { margin-top: 8px; font-size: 28px; font-weight: 600; letter-spacing: -.035em; line-height: 1.1; white-space: nowrap; }
.tf-live-r { text-align: right; }
.tf-live-rv { margin-top: 8px; font-size: 18px; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; color: var(--text); }
.tf-live .is-empty { color: var(--text-4); }
.tf-live-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line-soft); }
.tf-live-cell { min-width: 0; padding: 11px 18px 12px; }
.tf-live-cell + .tf-live-cell { border-left: 1px solid var(--line-soft); }
.tf-live-cell .cap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-live-v { margin-top: 5px; font-size: 13.5px; font-weight: 500; white-space: nowrap; }

/* ---------- chips, valoración ---------- */
.tf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tf-chip {
  height: 28px; padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .02);
  font-size: 12.5px; font-weight: 500; color: var(--text-2);
  white-space: nowrap;
  transition: color .14s, background .14s, border-color .14s;
}
.tf-chip:hover { border-color: var(--line-strong); color: var(--text); }
.tf-chip.is-on { color: var(--text); background: var(--blue-soft); border-color: var(--blue-line); }
.tf-chips-mistakes .tf-chip.is-on { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-line); }

.tf-stars { display: inline-flex; gap: 2px; margin-left: -5px; }
.tf-star { display: grid; place-items: center; width: 30px; height: 30px; border-radius: var(--r-sm); color: var(--text-4); transition: color .14s, background .14s; }
.tf-star:hover { background: var(--hover); color: var(--text-2); }
.tf-star.is-on { color: var(--text); }
.tf-star.is-on svg { fill: currentColor; }

/* ---------- modo de registro: rápido | detallado ---------- */
.tf-mode .seg button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 0; }
.tf-mode .seg button > span { overflow: hidden; text-overflow: ellipsis; }
.tf-mode-sub { font-weight: 400; color: var(--text-4); }
.tf-mode .seg button.is-active .tf-mode-sub { color: var(--text-3); }
.tf-mode .seg button:disabled { opacity: .38; cursor: not-allowed; pointer-events: none; }
.tf-mode-hint { margin-top: 9px; font-size: 12px; line-height: 1.5; color: var(--text-3); }

.tf-detailed { display: flex; flex-direction: column; gap: 26px; }
.tf-form[data-mode="quick"] .tf-detailed,
.tf-form[data-mode="quick"] .tf-only-detailed,
.tf-form[data-mode="quick"] .tf-l-detailed,
.tf-form[data-mode="detailed"] .tf-quick,
.tf-form[data-mode="detailed"] .tf-l-quick { display: none; }
.tf-form[data-mode="quick"] [data-field="setup"] { grid-column: 1 / -1; }
.tf-upper { text-transform: uppercase; }
.tf-upper::placeholder { text-transform: none; }

/* resultado por colores, como TP / SL / BE */
.tf-seg .seg[data-seg="outcome"] button.is-active[data-value="win"] { color: var(--pos); background: var(--pos-soft); box-shadow: inset 0 0 0 1px var(--pos-line); }
.tf-seg .seg[data-seg="outcome"] button.is-active[data-value="loss"] { color: var(--neg); background: var(--neg-soft); box-shadow: inset 0 0 0 1px var(--neg-line); }
.tf-pl .affix { min-width: 16px; font-variant-numeric: tabular-nums; }
.tf-pl .affix ~ .input { padding-left: 34px; }
.tf-sign.pos { color: var(--pos); }
.tf-sign.neg { color: var(--neg); }
.tf-rbox {
  display: flex; align-items: center;
  height: 36px; padding: 0 12px;
  border: 1px solid var(--line-soft); border-radius: var(--r-md);
  background: rgba(255, 255, 255, .02);
  font-size: 13.5px; font-weight: 600;
}
.tf-rbox.is-empty { font-weight: 500; color: var(--text-4); }

/* ---------- secciones plegables ---------- */
.tf-folds { border-top: 1px solid var(--line-soft); }
.tf-fold { border-bottom: 1px solid var(--line-soft); }
.tf-fold-head {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  height: 48px;
  text-align: left;
  color: var(--text-2);
  transition: color .14s;
}
.tf-fold-head:hover, .tf-fold.is-open .tf-fold-head { color: var(--text); }
.tf-fold-head:focus-visible { outline-offset: -2px; border-radius: var(--r-sm); }
.tf-fold-ic { display: grid; place-items: center; color: var(--text-3); }
.tf-fold-title { font-size: 13.5px; font-weight: 500; }
.tf-fold-count {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border: 1px solid var(--blue-line); border-radius: 9px;
  background: var(--blue-soft);
  font-size: 11px; font-weight: 600; line-height: 1; color: var(--text);
}
.tf-fold.is-open .tf-fold-count { display: none; }
.tf-fold-chev { margin-left: auto; display: grid; place-items: center; color: var(--text-3); transition: transform .2s var(--ease); }
.tf-fold.is-open .tf-fold-chev { transform: rotate(180deg); }
.tf-fold-body { padding: 2px 0 20px; }
.tf-stack { display: flex; flex-direction: column; gap: 14px; }
.tf-ta { min-height: 68px; }

/* ---------- evidencia visual ---------- */
.tf-imgs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.tf-img { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tf-img-box {
  position: relative;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--inset);
  overflow: hidden;
}
.tf-img-box img { width: 100%; height: 100%; object-fit: cover; }
.tf-img-ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 10px; font-size: 12px; text-align: center; color: var(--text-4); }
.tf-img-busy {
  position: absolute; inset: 0;
  display: none; align-items: center; justify-content: center; gap: 9px;
  background: rgba(5, 5, 5, .8);
  font-size: 12px; font-weight: 500; color: var(--text);
}
.tf-img.is-uploading .tf-img-busy { display: flex; }
.tf-img-busy .spinner { width: 14px; height: 14px; }
.tf-img-x {
  position: absolute; top: 6px; right: 6px;
  display: grid; place-items: center;
  width: 24px; height: 24px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: rgba(5, 5, 5, .78);
  color: var(--text-2);
  transition: color .14s, border-color .14s, background .14s;
}
.tf-img-x:hover { color: var(--neg); border-color: var(--neg-line); background: rgba(5, 5, 5, .92); }
.tf-img-cap { height: 32px; padding: 0 10px; font-size: 12.5px; border-radius: var(--r-sm); }

.tf-drop {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px;
  border: 1px dashed var(--line-strong); border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .015);
  cursor: pointer;
  transition: border-color .16s, background .16s;
}
.tf-drop:hover, .tf-drop.is-over { border-color: var(--blue-line); background: var(--blue-soft); }
.tf-drop:focus-within { border-color: rgba(61, 123, 255, .65); box-shadow: 0 0 0 3px rgba(61, 123, 255, .14); }
.tf-drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.tf-drop-ic { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(255, 255, 255, .025); color: var(--text-2); }
.tf-drop-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tf-drop-title { font-size: 13px; font-weight: 600; }
.tf-drop-hint { font-size: 12px; line-height: 1.45; color: var(--text-3); }
.tf-drop-n { margin-left: auto; flex: none; font-size: 12px; color: var(--text-3); }
.tf-drop.is-full { cursor: default; border-style: solid; border-color: var(--line-soft); background: none; }
.tf-drop.is-full input { cursor: default; }
.tf-drop.is-full .tf-drop-title, .tf-drop.is-full .tf-drop-ic { color: var(--text-4); }

/* ---------- factores de análisis ---------- */
.tf-factors { display: flex; flex-direction: column; gap: 16px; }
.tf-fgroup > .cap { display: block; margin-bottom: 8px; overflow-wrap: anywhere; }
.tf-factors .tf-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; }
.tf-factors .tf-chip > span { overflow: hidden; text-overflow: ellipsis; }
.tf-factors .tf-chip .ic { flex: none; opacity: .55; transition: transform .2s var(--ease); }
.tf-factors .tf-chip.is-on .ic { opacity: .9; transform: rotate(180deg); }
.tf-subchips {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-top: 8px; padding-left: 12px;
  border-left: 1px solid var(--blue-line);
}
.tf-sub-of { max-width: 100%; margin-right: 2px; font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-chip-sm { height: 24px; padding: 0 9px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }

/* ---------- pie ---------- */
.tf-overlay .drawer-foot { flex-wrap: wrap; }
.tf-del { margin-right: auto; }
.tf-kbd {
  margin-left: 2px;
  font-family: var(--sans); font-size: 11px; font-weight: 500; letter-spacing: .02em;
  opacity: .5;
}

@media (max-width: 480px) {
  .tf-grid.tf-stack-sm { grid-template-columns: minmax(0, 1fr); }
  .tf-live-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tf-live-cell:nth-child(3) { border-left: none; }
  .tf-live-cell:nth-child(n + 3) { border-top: 1px solid var(--line-soft); }
  .tf-live-net { font-size: 24px; }
  .tf-overlay .drawer-body { padding: 18px 16px 22px; }
  .tf-overlay .drawer-head { padding: 16px 16px 14px; }
  .tf-overlay .drawer-foot { padding: 12px 16px; }
  .tf-kbd { display: none; }
  .tf-del span { display: none; }
  .tf-del { width: 34px; padding: 0; }
  .tf-mode-sub { display: none; }
  .tf-imgs { gap: 10px; }
  .tf-drop-hint { font-size: 11.5px; }
}
