/* portfolio-dash — 輸入中心 styles (loads after styles.css / settings.css / trades.css) */

/* Draft → Confirm two-column layout */
.dc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr);
  gap: var(--gap);
  padding: 14px var(--pad) 16px;
  align-items: start;
}

.preview-card {
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 64px;
}
.preview-card .pc-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.05em;
}
.pc-big { display: flex; align-items: baseline; gap: 8px; }
.pc-big .v { font-family: var(--font-num); font-size: 22px; font-weight: 600; }
.pc-big .c { font-size: 11px; color: var(--text-3); }
.pc-rows { display: flex; flex-direction: column; }
.pc-row {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--border-soft);
  font-size: 11px;
}
.pc-row:last-child { border-bottom: none; }
.pc-row .k { color: var(--text-3); }
.pc-row .v { font-family: var(--font-num); }
/* A caveat ON a projected number (F-01 owner ruling 2026-08-27): the 賣超 branch shows the
   average the ledger will actually hold — zero — and the note says WHY it is zero, so the
   figure agrees with what gets written without reading as "your average cost is 0". */
.pc-row .pc-note { color: var(--text-3); font-size: 10.5px; margin-left: 6px; }
.ovr-chip {
  font-size: 9px;
  color: var(--amber);
  border: 1px solid rgba(217, 161, 63, 0.4);
  border-radius: 3px;
  padding: 0 4px;
  margin-left: 5px;
}

/* issues list */
.issues { display: flex; flex-direction: column; gap: 6px; }
.issue {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 11px;
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  line-height: 1.5;
}
.issue-error { color: var(--up); background: var(--up-soft); border: 1px solid rgba(240, 84, 79, 0.3); }
.issue-warn { color: var(--amber); background: var(--amber-soft); border: 1px solid rgba(217, 161, 63, 0.3); }
.issue-ok { color: var(--ok); background: var(--ok-soft); border: 1px solid rgba(79, 174, 108, 0.3); }
.issue-info { color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(88, 166, 221, 0.3); }
/* drag-over highlight for the REAL csv dropzone */
.dropzone.dz-over { border-color: var(--accent); background: var(--accent-soft); }
.issue label { display: flex; gap: 7px; align-items: flex-start; cursor: pointer; color: var(--text-2); }
.issue input[type="checkbox"] { accent-color: var(--amber); margin-top: 1px; }

.pc-actions { display: flex; gap: 8px; justify-content: flex-end; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* field-level error highlight */
.input.field-error, .select.field-error { border-color: var(--up); }

/* pencil override row */
.fee-line { display: flex; align-items: center; gap: 8px; }
.fee-line .input { max-width: 130px; text-align: right; }
.pencil {
  background: none; border: 1px solid transparent; cursor: pointer;
  color: var(--text-3); font-size: 12px; padding: 2px 5px; border-radius: var(--radius-sm);
}
.pencil:hover { color: var(--accent); }
/* FU-D7: a pressed pencil = override ON (field editable). aria-pressed is the single
   state source (input.js toggles it); the active look makes the toggle obvious. */
.pencil[aria-pressed="true"] {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(88, 166, 221, 0.4);
}

/* FU-D7: edit-dialog 還原自動 affordance — clears the fee/tax dirty flag + re-fetches the
   computed value so an accidental override can be undone within the dialog. */
.edit-revert-line { display: flex; align-items: center; gap: 8px; }
.edit-revert-line .input { flex: 1 1 auto; min-width: 0; }
.edit-revert { flex: 0 0 auto; white-space: nowrap; }
.hint-link { color: var(--accent); text-decoration: none; font-size: 10px; }
.hint-link:hover { text-decoration: underline; }

/* CSV sub-select + result banner */
.sub-chips { display: flex; gap: 6px; padding: 12px var(--pad) 0; }
.result-banner {
  margin: 12px var(--pad) 0;
  border: 1px solid rgba(79, 174, 108, 0.4);
  background: var(--ok-soft);
  color: var(--ok);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 12px;
}
.result-banner details { color: var(--text-2); font-size: 11px; margin-top: 4px; }
.result-banner summary { cursor: pointer; color: var(--ok); }

/* AI degradation panels */
.degrade-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 56px 24px;
  text-align: center;
}
.degrade-panel .glyph {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1.5px dashed var(--text-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  color: var(--text-3);
}
.degrade-panel .ttl { font-size: 13px; font-weight: 700; }
.degrade-panel .sub { font-size: 11px; color: var(--text-3); max-width: 380px; }

/* design-review state switcher */
.state-switch {
  display: flex; gap: 6px; align-items: center;
  padding: 10px var(--pad) 0;
  font-size: 10px; color: var(--text-3);
}

/* dividend morphing form note */
.model-note {
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(88, 166, 221, 0.3);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
}

/* fx implied rate readout */
.fx-implied {
  display: flex; align-items: baseline; gap: 8px;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-top: 4px;
}
.fx-implied .v { font-family: var(--font-num); font-size: 17px; font-weight: 600; }
.fx-implied .k { font-size: 11px; color: var(--text-3); }

.two-stack { display: flex; flex-direction: column; gap: var(--gap); padding: 14px var(--pad) 16px; }
.stack-card {
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 13px 15px;
}
.stack-card h3 { margin: 0 0 10px; font-size: 13px; }
.stack-card .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack-card .form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

@media (max-width: 1200px) {
  .dc-grid { grid-template-columns: 1fr; }
  .preview-card { position: static; }
}
