/* ---------- Journal: Trades-Liste ---------- */

.jr-body {
  padding: 14px 20px 20px;
}

.jr-row {
  cursor: pointer;
}

.jr-date {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: left;
}

.jr-confs {
  max-width: 320px;
}

.jr-chip {
  display: inline-block;
  margin: 1px 3px 1px 0;
  padding: 1px 7px;
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 99px;
  white-space: nowrap;
}

.jr-chip.is-more {
  color: var(--text-muted);
}

.jr-thumbs {
  white-space: nowrap;
}

.jr-thumb {
  width: 46px;
  height: 30px;
  margin-right: 4px;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  vertical-align: middle;
  cursor: zoom-in;
}

.jr-status {
  font-size: 12px;
  color: var(--text-muted);
}

.jr-status.is-open {
  color: var(--text-primary);
}

.jr-undoc {
  display: inline-block;
  padding: 1px 7px;
  font-size: 11px;
  color: var(--warning);
  border: 1px solid var(--warning);
  border-radius: 99px;
  white-space: nowrap;
  vertical-align: middle;
}

.jr-src {
  margin-left: 6px;
  padding: 0 5px;
  font-family: var(--font-num);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  vertical-align: middle;
}

/* Zähler "ohne Screenshots" am Reiter Journal */
.tab-badge {
  display: inline-block;
  min-width: 18px;
  margin-left: 6px;
  padding: 0 5px;
  font-family: var(--font-num);
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  color: #000;
  background: var(--warning);
  border-radius: 99px;
}

.tab-badge[hidden] {
  display: none;
}

/* ---------- Trade-Dialog ---------- */

.dlg-wide {
  width: min(1180px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.dlg-spacer {
  flex: 1;
}

.jt-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 20px;
}

.jt-fields {
  display: grid;
  gap: 12px;
  align-content: start;
}

.jt-field {
  display: grid;
  gap: 4px;
}

/* Eingabefelder dürfen schmaler werden als ihre Standardbreite, sonst
   sprengen vier Preisfelder nebeneinander den Rahmen. */
.dlg input,
.dlg select {
  min-width: 0;
  width: 100%;
}

.jr-table .sig-dir {
  white-space: nowrap;
}

.jt-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.dlg textarea {
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-base);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  resize: vertical;
}

.dlg textarea:focus {
  outline: none;
  border-color: var(--text-secondary);
}

.jt-box {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 10px 12px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.jt-box legend {
  padding: 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.seg-input {
  width: max-content;
  margin: 0;
}

.seg-input button {
  padding: 5px 12px;
  font-size: 13px;
}

.jt-conf-group {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  margin-bottom: 6px;
}

.jt-conf-group .jt-label {
  padding-top: 4px;
}

.jt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.jt-chip {
  padding: 3px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
  border-radius: 99px;
}

.jt-chip:hover {
  color: var(--text-primary);
}

.jt-chip[aria-pressed="true"] {
  color: var(--bg-base);
  background: var(--text-primary);
  border-color: var(--text-primary);
}

.jt-combo {
  margin: 4px 0 0;
  font-size: 12px;
}

.jt-shots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: min-content;
  gap: 10px;
  align-content: start;
}

.jt-shots .dlg-hint {
  grid-column: 1 / -1;
}

.shot {
  position: relative;
  display: grid;
  place-content: center;
  gap: 2px;
  aspect-ratio: 16 / 10;
  text-align: center;
  background: var(--bg-base);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
}

.shot:focus {
  outline: none;
  border-color: var(--text-primary);
  border-style: solid;
}

.shot.is-drop {
  border-color: var(--text-primary);
  background: var(--accent-wash);
}

.shot-label {
  font-size: 13px;
  font-weight: 600;
}

.shot-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.shot.has-image .shot-hint {
  display: none;
}

.shot.has-image .shot-label {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 1;
  padding: 1px 7px;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 4px;
}

.shot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
}

.shot-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 1;
  width: 22px;
  height: 22px;
  font-size: 11px;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
}

/* Bild auf Anfrage aus MT5 */
.shot-mt5 {
  margin-top: 6px;
  padding: 3px 10px;
  font-size: 11px;
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
  border-radius: 99px;
}

.shot-mt5:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.shot-mt5:disabled {
  cursor: progress;
  border-style: dashed;
}

.shot.is-waiting {
  border-color: var(--text-secondary);
}

/* Trade-Verlauf (Kerzen aus MT5) */
.jt-chart {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  margin-top: 4px;
}

.jt-chart[hidden] {
  display: none;
}

.jt-chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
}

.jt-chart-body {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.jt-chart-msg {
  margin: 0;
  padding: 26px 14px;
  font-size: 12px;
  text-align: center;
}

.tc-svg {
  display: block;
  width: 100%;
  height: auto;
}

.tc-wick {
  stroke-width: 1;
}

.tc-body.tc-up {
  fill: #d4d4d4;
}

.tc-wick.tc-up {
  stroke: #d4d4d4;
}

.tc-body.tc-down {
  fill: #3f3f3f;
  stroke: #8a8a8a;
  stroke-width: 0.6;
}

.tc-wick.tc-down {
  stroke: #8a8a8a;
}

.tc-risk {
  fill: rgba(248, 113, 113, 0.13);
}

.tc-reward {
  fill: rgba(52, 211, 153, 0.13);
}

.tc-line {
  stroke-width: 1.4;
}

.tc-sl {
  stroke: var(--danger);
}

.tc-tp {
  stroke: var(--success);
}

.tc-entry {
  stroke: #ffffff;
  stroke-dasharray: 3 3;
}

.tc-path {
  stroke: #ffffff;
  stroke-width: 1;
  stroke-dasharray: 5 4;
  opacity: 0.7;
}

.tc-in {
  fill: #ffffff;
}

.tc-out {
  stroke: #000000;
  stroke-width: 1.5;
}

.tc-out.is-win {
  fill: var(--success);
}

.tc-out.is-loss {
  fill: var(--danger);
}

.tc-tag,
.tc-time {
  font-family: var(--font-num);
  font-size: 10px;
  fill: var(--text-muted);
}

.tc-tag-sl {
  fill: var(--danger);
}

.tc-tag-tp {
  fill: var(--success);
}

.tc-tag-entry,
.tc-tag-exit {
  fill: var(--text-primary);
}

/* ---------- Galerie ---------- */

.jg-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 14px;
  font-size: 12px;
}

.jg-empty {
  font-size: 13px;
}

.jg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.jg-card {
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 0;
  text-align: left;
  color: inherit;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s var(--ease);
}

.jg-card:hover,
.jg-card:focus-visible {
  border-color: var(--text-secondary);
  outline: none;
}

.jg-media {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  background: var(--bg-base);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.jg-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.jg-none {
  font-size: 12px;
  color: var(--text-muted);
}

.jg-info {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 10px 12px 12px;
}

.jg-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
}

.jg-pair {
  font-size: 14px;
  font-weight: 600;
}

.jg-quality {
  margin-left: auto;
  padding: 0 6px;
  font-size: 11px;
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
}

.jg-quality.is-aplus {
  color: var(--bg-base);
  background: var(--text-primary);
  border-color: var(--text-primary);
}

.jg-result {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 600;
}

.jg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.jg-lesson {
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 12px;
  color: var(--text-secondary);
}

.jt-delete:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* Bild in groß */
.dlg-image {
  padding: 0;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  background: transparent;
  border: none;
  cursor: zoom-out;
}

.dlg-image::backdrop {
  background: rgba(0, 0, 0, 0.85);
}

.dlg-image img {
  display: block;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  border-radius: var(--radius);
}

/* ---------- Mindset ---------- */

.jm-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.jm-form,
.jm-history {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.jm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.jm-head h3,
.jm-history h3 {
  margin: 0;
  font-size: 15px;
}

.jm-form input[type="date"],
.jm-form textarea {
  font: inherit;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color-scheme: dark;
}

.jm-form input[type="date"] {
  height: 32px;
  padding: 0 8px;
}

.jm-form textarea {
  padding: 8px 10px;
  resize: vertical;
}

.jm-scales {
  display: grid;
  gap: 8px;
}

.jm-row {
  display: grid;
  grid-template-columns: 140px auto;
  align-items: center;
  gap: 10px;
}

.jm-scale {
  display: flex;
  gap: 6px;
}

.jm-dot {
  width: 34px;
  height: 30px;
  font-family: var(--font-num);
  font-size: 13px;
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.jm-dot:hover {
  color: var(--text-primary);
}

.jm-dot[aria-pressed="true"] {
  color: var(--bg-base);
  background: var(--text-primary);
  border-color: var(--text-primary);
}

.jm-area {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}

.jm-saved {
  margin-right: auto;
  align-self: center;
  font-size: 12px;
}

.jm-history {
  max-height: calc(100vh - 220px);
  overflow: auto;
}

.jm-item {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.jm-item:hover,
.jm-item.is-active {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.jm-item-top {
  display: flex;
  gap: 12px;
  align-items: baseline;
  font-size: 12px;
}

.jm-item-top .num {
  margin-left: auto;
}

.jm-item-date {
  font-weight: 600;
  color: var(--text-primary);
}

.jm-item-text {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Auswertung ---------- */

.js-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.js-kpi {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.js-kpi-label {
  font-size: 11px;
  color: var(--text-muted);
}

.js-kpi-value {
  font-size: 18px;
  font-weight: 600;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.js-curve {
  margin-bottom: 18px;
  padding: 12px 14px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.js-curve-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.js-curve-svg {
  display: block;
  width: 100%;
  height: 180px;
}

.js-curve-zero {
  stroke: var(--border-strong);
  stroke-width: 1;
  stroke-dasharray: 4 4;
  vector-effect: non-scaling-stroke;
}

.js-curve-line {
  fill: none;
  stroke: var(--text-primary);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.js-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 14px;
}

.js-block {
  padding: 12px 14px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.js-block h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.js-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.js-table th {
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: left;
}

.js-table th.num {
  text-align: right;
}

.js-table td {
  padding: 5px 6px;
  border-top: 1px solid var(--border);
}

.js-label {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.js-empty {
  margin: 0;
  font-size: 12px;
}
