/* Canonical CSS owner: review. Historical layers consolidated 2026-08-02. */
:where(#reviewWorkspaceView) .notes-history {
  gap: 8px;
}

@media (max-width: 860px) {
  .review-workspace {
    grid-template-columns: 1fr;
  }

  .workspace-section {
    border-right: 0px;
  }

  .notes-history-section {
    grid-column: auto;
  }
}

.trade-log-heading > div {
  display: flex;

  align-items: baseline;

  gap: 9px;

  min-width: 0px;
}

.trade-log-heading > div > span {
  color: var(--text-secondary);

  font-size: 11px;
}

:where(#reviewWorkspaceView) .trade-log-heading .button {
  flex: 0 0 auto;
}

.trade-log-dialog {
  width: min(1020px, -24px + 100vw);

  overflow-y: auto;
}

.trade-log-form {
  padding: 16px;

  border-top: 1px solid var(--border);

  border-bottom: 1px solid var(--border);

  background: var(--surface-muted);
}

.trade-log-form-grid {
  display: grid;

  grid-template-columns: repeat(5, minmax(0px, 1fr));

  gap: 12px;
}

.trade-tags-field {
  grid-column: span 2;
}

.trade-log-text-grid {
  display: grid;

  grid-template-columns: 1fr 1fr;

  gap: 12px;

  margin-top: 12px;
}

.trade-log-text-grid textarea {
  min-height: 82px;
}

.trade-log-table td.number small {
  display: block;

  margin-top: 3px;

  font-size: 9px;
}

:where(#reviewWorkspaceView) .trade-copy {
  max-width: 210px;

  text-overflow: ellipsis;

  white-space: nowrap;
}

:where(#reviewWorkspaceView) .trade-tags em {
  font-style: normal;
}

@media (max-width: 900px) {
  .trade-log-form-grid {
    grid-template-columns: repeat(2, minmax(0px, 1fr));
  }

  .trade-tags-field {
    grid-column: auto;
  }
}

@media (max-width: 767px) {
  .trade-log-dialog {
    width: calc(-16px + 100vw);

    margin: 8px auto;
  }

  .trade-log-form-grid,
  .trade-log-text-grid {
    grid-template-columns: 1fr;
  }
}

:where(#reviewWorkspaceView) .workspace-section {
  padding: 16px;

  border-color: var(--border);
}

.workspace-table-frame {
  min-height: 340px;

  max-height: 480px;

  border: 0px;
}

:where(#reviewWorkspaceView) .notes-history-section {
  grid-column: 1 / -1;

  min-height: 260px;

  border-top-color: var(--border);
}

:where(#reviewWorkspaceView) .trade-journal-section {
  grid-column: 1 / -1;

  border-top-color: var(--border);
}

:where(#reviewWorkspaceView) .trade-log-summary {
  border-bottom-color: var(--border);
}

@media (max-width: 767px) {
  :where(#reviewWorkspaceView) .workspace-section {
    min-width: 0px;

    border-right: 0px;

    border-bottom: 1px solid var(--border);
  }

  .watchlist-section .workspace-table-frame {
    min-height: 0px;

    max-height: 360px;
  }

  .watchlist-section .empty-state {
    min-height: 160px;
  }
}

@media (max-width: 900px) {
  body[data-active-view="reviewWorkspaceView"] .workspace-view {
    padding: 10px 0 84px;
  }

  .review-workspace .notes-history-section,
  .review-workspace .trade-journal-section {
    grid-column: 1;
  }
}

body[data-active-view="reviewWorkspaceView"] .workspace-view {
  width: auto;

  max-width: none;

  margin: 0px;

  border: 0px;

  border-radius: 0px;

  background: transparent;

  box-shadow: none;

  padding: var(--page-pad-y) 0 24px;
}

.review-workspace .workspace-section + .workspace-section {
  border-top: 1px solid var(--border);
}

@media (max-width: 767px) {
  body[data-active-view="reviewWorkspaceView"] .workspace-view {
    margin-top: 0px;

    border-radius: 7px;

    padding: 0px 0px 76px;
  }
}

.trade-journal-section .trade-log-summary {
  min-height: 58px;
}

.notes-history-section .notes-history {
  min-height: 84px;
}

#reviewWorkspaceView > .section-toolbar {
  margin-bottom: 10px;
}

.review-workspace .workspace-section {
  background: var(--surface);

  border: 1px solid var(--border);

  overflow: hidden;

  border-radius: 10px;

  box-shadow: var(--shadow-card);

  min-height: 0px !important;
}

.review-workspace .watchlist-section {
  min-height: 0px;

  grid-area: watch;
}

.review-workspace .trade-journal-section {
  min-height: 0px;

  grid-area: trades;
}

.review-workspace .journal-section {
  min-height: 0px;

  grid-area: journal;
}

.review-workspace .notes-history-section {
  grid-area: notes;
}

.review-workspace .workspace-heading {
  padding: 8px 14px;

  min-height: 42px;
}

.watchlist-section .data-table thead th {
  height: 36px;

  padding: 0 12px;
}

.watchlist-section .data-table tbody td {
  height: 40px;

  padding: 0 12px;
}

.trade-journal-section .trade-log-summary:empty {
  display: none;
}

.trade-journal-section .trade-log-summary:not(:empty) {
  min-height: 56px;
}

:where(#reviewWorkspaceView) .journal-form textarea {
  border-color: var(--border-strong);
}

.journal-form .form-field:last-of-type textarea {
  min-height: 86px;

  height: 86px;
}

:where(#reviewWorkspaceView) .journal-form .dialog-actions {
  margin-top: 4px;
}

#reviewHistoryToggle[aria-expanded="true"] {
  border-color: var(--primary);

  color: var(--primary);
}

@media (max-width: 767px) {
  :where(#reviewWorkspaceView) .review-workspace {
    display: block;

    grid-template-columns: 1fr;

    grid-template-areas: "watch" "journal" "trades" "notes";
  }
}

#reviewWorkspaceView {
  --review-blue: var(--action);

  --review-blue-dark: var(--action-hover);

  --review-blue-soft: var(--action-soft);

  --review-blue-line: var(--color-action-line);

  --review-line: var(--border);

  --review-line-soft: var(--border-subtle);

  --review-ink: var(--text-primary);

  --review-sub: var(--text-secondary);

  --review-faint: var(--text-tertiary);

  color: var(--review-ink);
}

#reviewWorkspaceView .review-page-header {
  min-height: 42px;

  display: flex;

  align-items: center;

  gap: 14px;

  margin: 0px 0px 12px;

  padding: 0px;

  border: 0px;

  background: transparent;
}

#reviewWorkspaceView .review-page-title {
  min-width: 0px;

  display: flex;

  align-items: baseline;

  gap: 10px;
}

#reviewWorkspaceView .review-page-title .section-subtitle b {
  color: var(--review-sub);

  font-weight: 600;

  font-variant-numeric: tabular-nums;
}

#reviewWorkspaceView .review-history-toggle {
  min-height: 32px;

  display: inline-flex;

  align-items: center;

  gap: 5px;

  margin-left: auto;

  padding: 0px 10px;

  border: 1px solid var(--review-line);

  border-radius: 8px;

  background: var(--surface);

  color: var(--text-secondary);

  font-size: var(--font-size-label);

  white-space: nowrap;
}

#reviewWorkspaceView .review-history-toggle:hover,
#reviewWorkspaceView .review-history-toggle[aria-expanded="true"] {
  border-color: var(--review-blue-line);

  background: var(--review-blue-soft);

  color: var(--review-blue);
}

#reviewWorkspaceView .review-history-toggle .lucide {
  width: 14px;

  height: 14px;
}

#reviewWorkspaceView .review-workspace {
  display: grid;

  grid-template-columns: minmax(0px, 1fr) 360px;

  grid-template-areas: "left journal" "history history";

  align-items: start;

  gap: 12px;

  border: 0px;

  background: transparent;

  box-shadow: none;
}

#reviewWorkspaceView .review-left-stack {
  min-width: 0px;

  display: flex;

  grid-area: left;

  flex-direction: column;

  gap: 12px;
}

#reviewWorkspaceView .notes-history-section[hidden] {
  display: none !important;
}

#reviewWorkspaceView .workspace-section {
  min-width: 0px;

  overflow: hidden;

  border: 1px solid var(--review-line);

  border-radius: 10px;

  background: var(--surface);

  box-shadow: var(--shadow-card);
}

#reviewWorkspaceView .review-card-heading > div {
  min-width: 0px;

  display: flex;

  align-items: baseline;

  gap: 8px;
}

#reviewWorkspaceView .review-card-heading > small {
  margin-left: auto;

  color: var(--review-faint);

  font-size: 10.5px;

  white-space: nowrap;
}

#reviewWorkspaceView .review-count-tag {
  min-height: 20px;

  display: inline-flex;

  align-items: center;

  padding: 0px 7px;

  border-radius: 5px;

  background: var(--surface-muted);

  color: var(--review-sub);

  font-size: 10.5px;

  font-weight: 500;

  white-space: nowrap;
}

#reviewWorkspaceView .data-table thead th {
  height: 36px;

  padding: 0 12px;

  border-bottom: 1px solid var(--review-line-soft);

  background: var(--surface-subtle);

  color: var(--review-faint);

  font-size: var(--font-size-caption);

  font-weight: var(--font-weight-semibold);
}

#reviewWorkspaceView .data-table tbody td {
  height: 40px;

  padding: 0 12px;

  border-bottom: 1px solid var(--review-line-soft);

  color: var(--text-primary);

  font-size: var(--font-size-table);
}

#reviewWorkspaceView .data-table tbody tr:last-child td {
  border-bottom: 0px;
}

#reviewWorkspaceView .data-table tbody tr:hover {
  background: var(--table-hover);
}

#reviewWorkspaceView .stock-cell {
  display: grid;

  gap: 2px;
}

#reviewWorkspaceView .stock-cell strong {
  color: var(--review-ink);

  font-size: var(--font-size-table);
}

#reviewWorkspaceView .stock-cell small {
  color: var(--review-faint);

  font-size: var(--font-size-aux);
}

#reviewWorkspaceView .review-watch-mark {
  color: var(--text-tertiary);

  font-size: 15px;

  line-height: 1;
}

#reviewWorkspaceView .review-watch-mark.red {
  color: var(--market-up);
}

#reviewWorkspaceView .review-row-actions {
  display: inline-flex;

  align-items: center;

  justify-content: flex-end;

  gap: 3px;
}

#reviewWorkspaceView .trade-row-actions {
  display: inline-flex;

  align-items: center;

  justify-content: flex-end;

  gap: 3px;
}

#reviewWorkspaceView .table-action {
  min-height: 32px;

  padding: 0px 6px;

  border: 0px;

  border-radius: 8px;

  background: transparent;

  color: var(--review-blue);

  font-size: var(--font-size-label);
}

#reviewWorkspaceView .table-action:hover {
  background: var(--review-blue-soft);
}

#reviewWorkspaceView .table-action.down {
  color: var(--text-tertiary);
}

#reviewWorkspaceView .table-action.down:hover {
  background: var(--surface-hover);

  color: var(--market-up);
}

#reviewWorkspaceView .trade-log-table-frame .empty-state {
  min-height: 108px;

  display: grid;

  place-items: center;

  padding: 22px;

  color: var(--review-faint);

  font-size: 11.5px;

  text-align: center;
}

#reviewWorkspaceView .watchlist-section .empty-state {
  min-height: 108px;

  display: grid;

  place-items: center;

  padding: 22px;

  color: var(--review-faint);

  font-size: 11.5px;

  text-align: center;
}

#reviewWorkspaceView .trade-journal-section {
  padding: 0px;
}

#reviewWorkspaceView .trade-log-heading .button {
  min-height: 32px;

  display: inline-flex;

  align-items: center;

  gap: 5px;

  margin-left: auto;

  padding: 0px 10px;

  border-radius: 8px;

  background: var(--review-blue);

  color: var(--text-inverse);

  font-size: var(--font-size-label);
}

#reviewWorkspaceView .trade-log-heading .button:hover {
  background: var(--review-blue-dark);
}

#reviewWorkspaceView .trade-log-heading .button .lucide {
  width: 13px;

  height: 13px;
}

#reviewWorkspaceView .trade-log-summary {
  min-height: 52px;

  display: grid;

  grid-template-columns: repeat(5, minmax(0px, 1fr));

  border-top: 0px;

  border-right: 0px;

  border-left: 0px;

  border-image: none;

  border-bottom: 1px solid var(--review-line-soft);

  background: var(--surface);
}

#reviewWorkspaceView .trade-log-summary:empty {
  display: none;
}

#reviewWorkspaceView .trade-log-summary > div {
  min-width: 0px;

  padding: 8px 11px;

  border-right: 1px solid var(--review-line-soft);
}

#reviewWorkspaceView .trade-log-summary > div:last-child {
  border-right: 0px;
}

#reviewWorkspaceView .trade-log-summary span {
  display: block;

  overflow: hidden;

  color: var(--review-faint);

  font-size: 9.5px;

  text-overflow: ellipsis;

  white-space: nowrap;
}

#reviewWorkspaceView .trade-log-summary strong {
  display: block;

  margin-top: 3px;

  overflow: hidden;

  color: var(--review-ink);

  font-size: 13px;

  font-variant-numeric: tabular-nums;

  text-overflow: ellipsis;

  white-space: nowrap;
}

#reviewWorkspaceView .trade-log-table-frame {
  min-height: 108px;

  max-height: 314px;

  overflow: auto;

  border: 0px;

  border-radius: 0px;
}

#reviewWorkspaceView .trade-log-table-frame thead th {
  position: sticky;

  z-index: 2;

  top: 0px;
}

#reviewWorkspaceView .trade-action {
  min-height: 21px;

  display: inline-flex;

  align-items: center;

  padding: 0px 6px;

  border: 1px solid var(--review-line);

  border-radius: 5px;

  background: var(--surface-subtle);

  color: var(--review-sub);

  font-size: 9.5px;

  white-space: nowrap;
}

#reviewWorkspaceView .trade-emotion {
  min-height: 21px;

  display: inline-flex;

  align-items: center;

  padding: 0px 6px;

  border: 1px solid var(--review-line);

  border-radius: 5px;

  background: var(--surface-subtle);

  color: var(--review-sub);

  font-size: 9.5px;

  white-space: nowrap;
}

#reviewWorkspaceView .trade-action-add {
  border-color: var(--market-up);

  background: var(--market-up-soft);

  color: var(--market-up);
}

#reviewWorkspaceView .trade-action-buy {
  border-color: var(--market-up);

  background: var(--market-up-soft);

  color: var(--market-up);
}

#reviewWorkspaceView .trade-action-sell {
  border-color: var(--market-down);

  background: var(--market-down-soft);

  color: var(--market-down);
}

#reviewWorkspaceView .trade-action-trim {
  border-color: var(--market-down);

  background: var(--market-down-soft);

  color: var(--market-down);
}

#reviewWorkspaceView .trade-tags {
  display: flex;

  flex-wrap: wrap;

  gap: 3px;

  margin-top: 4px;
}

#reviewWorkspaceView .trade-tags em {
  padding: 1px 4px;

  border-radius: 3px;

  background: var(--review-blue-soft);

  color: var(--action);

  font-size: 8.5px;
}

#reviewWorkspaceView .trade-copy {
  overflow: hidden;

  color: var(--review-sub);
}

#reviewWorkspaceView .trade-copy strong {
  display: block;

  overflow: hidden;

  text-overflow: ellipsis;

  white-space: nowrap;

  color: var(--text-secondary);

  font-size: 10.5px;

  font-weight: 600;
}

#reviewWorkspaceView .trade-copy small {
  display: block;

  overflow: hidden;

  text-overflow: ellipsis;

  white-space: nowrap;

  margin-top: 3px;

  color: var(--review-faint);

  font-size: 9.5px;
}

#reviewWorkspaceView .journal-section {
  min-width: 0px;

  grid-area: journal;

  align-self: start;
}

#reviewWorkspaceView .journal-section .review-card-heading {
  justify-content: space-between;
}

#reviewWorkspaceView .journal-section .date-input {
  width: 124px;

  min-height: 28px;

  margin-left: auto;

  padding: 0px 8px;

  border: 1px solid var(--review-line);

  border-radius: 6px;

  background: var(--surface-subtle);

  color: var(--review-sub);

  font-size: 10.5px;
}

#reviewWorkspaceView .journal-form {
  display: grid;

  gap: 13px;

  padding: 14px 16px 16px;

  background: var(--surface);
}

#reviewWorkspaceView .journal-form .form-field:nth-of-type(2) textarea {
  height: 104px;

  min-height: 104px;
}

#reviewWorkspaceView .journal-form textarea:focus {
  border-color: var(--review-blue-line);

  box-shadow: 0 0 0 2px var(--focus-ring);
}

#reviewWorkspaceView .journal-form textarea::placeholder {
  color: var(--review-faint);
}

#reviewWorkspaceView .journal-form .dialog-actions {
  display: flex;

  justify-content: flex-end;

  margin: 0px;
}

#reviewWorkspaceView .journal-form .button {
  min-height: 32px;

  display: inline-flex;

  align-items: center;

  justify-content: center;

  gap: 5px;

  padding: 0px 14px;

  border-radius: 8px;

  background: var(--review-blue);

  color: var(--text-inverse);

  font-size: var(--font-size-label);
}

#reviewWorkspaceView .journal-form .button:hover {
  background: var(--review-blue-dark);
}

#reviewWorkspaceView .journal-form .button .lucide {
  width: 14px;

  height: 14px;
}

#reviewWorkspaceView .notes-history-section {
  min-width: 0px;

  grid-area: history;

  margin-top: 0px;
}

#reviewWorkspaceView .notes-history {
  max-height: 420px;

  display: grid;

  overflow-y: auto;

  background: var(--surface);
}

#reviewWorkspaceView .note-row {
  grid-template-columns: 88px minmax(0px, 0.8fr) minmax(0px, 1.2fr) minmax(0px, 1fr) auto;

  min-height: 78px;

  padding: 12px 14px;

  border-bottom: 1px solid var(--review-line-soft);
}

@media (max-width: 900px) {
  #reviewWorkspaceView .note-row {
    grid-template-columns: 80px repeat(2, minmax(0px, 1fr)) auto;
  }

  #reviewWorkspaceView .note-row .note-block:nth-of-type(3) {
    grid-column: 2 / -1;
  }
}

@media (max-width: 767px) {
  #reviewWorkspaceView .note-row {
    grid-template-columns: 1fr auto;
  }

  #reviewWorkspaceView .note-row .note-block,
  #reviewWorkspaceView .note-row .note-block:nth-of-type(3) {
    grid-column: 1 / -1;
  }
}

#reviewWorkspaceView .note-row:last-child {
  border-bottom: 0px;
}

@media (max-width: 1100px) {
  #reviewWorkspaceView .review-workspace {
    grid-template-columns: minmax(0px, 1fr) 340px;
  }

  #reviewWorkspaceView .review-card-heading > small {
    display: none;
  }
}

@media (max-width: 900px) {
  #reviewWorkspaceView .review-workspace {
    grid-template-columns: minmax(0px, 1fr);

    grid-template-areas: "left" "journal" "history";
  }
}

@media (max-width: 767px) {
  #reviewWorkspaceView .review-page-header {
    min-height: 68px;

    align-items: flex-start;

    padding: 10px 10px 0px;
  }

  #reviewWorkspaceView .review-page-title {
    display: grid;

    gap: 3px;
  }

  #reviewWorkspaceView .review-page-title h2 {
    font-size: 17px;
  }

  #reviewWorkspaceView .review-page-title .section-subtitle {
    max-width: calc(-145px + 100vw);

    font-size: 9.5px;
  }

  #reviewWorkspaceView .review-history-toggle {
    min-height: 38px;
  }

  #reviewWorkspaceView .review-workspace {
    gap: 10px;

    padding: 0px 8px;
  }

  #reviewWorkspaceView .review-left-stack {
    gap: 10px;
  }

  #reviewWorkspaceView .workspace-section {
    border-radius: 9px;
  }

  #reviewWorkspaceView .review-card-heading {
    min-height: 44px;

    padding: 8px 11px;
  }

  #reviewWorkspaceView .trade-log-summary {
    grid-template-columns: repeat(2, minmax(0px, 1fr));
  }

  #reviewWorkspaceView .trade-log-summary > div {
    border-bottom: 1px solid var(--review-line-soft);
  }

  #reviewWorkspaceView .trade-log-summary > div:nth-child(2n) {
    border-right: 0px;
  }

  #reviewWorkspaceView .trade-log-table {
    min-width: 700px;
  }

  #reviewWorkspaceView .journal-form {
    padding: 12px;
  }

  #reviewWorkspaceView .journal-form .form-field:nth-of-type(2) textarea {
    height: 96px;

    min-height: 96px;
  }

  #reviewWorkspaceView .journal-form .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  #reviewWorkspaceView .review-history-toggle,
  #reviewWorkspaceView .table-action {
    transition: none;
  }
}

@media (min-width: 901px) {
  #reviewWorkspaceView .review-workspace {
    align-items: stretch;
  }

  #reviewWorkspaceView .review-left-stack {
    height: clamp(540px, -250px + 100vh, 650px);

    min-height: 0px;
  }

  #reviewWorkspaceView .watchlist-section {
    flex: 0 0 auto;
  }

  #reviewWorkspaceView .trade-journal-section {
    min-height: 0px;

    display: flex;

    flex: 1 1 auto;

    flex-direction: column;
  }

  #reviewWorkspaceView .trade-log-table-frame {
    min-height: 0px;

    max-height: none;

    flex: 1 1 auto;

    overflow: auto;
  }

  #reviewWorkspaceView .journal-section {
    height: clamp(540px, -250px + 100vh, 650px);

    min-height: 0px;

    display: flex;

    align-self: stretch;

    flex-direction: column;
  }

  #reviewWorkspaceView .journal-form {
    min-height: 0px;

    display: flex;

    flex: 1 1 auto;

    flex-direction: column;
  }

  #reviewWorkspaceView .journal-form .form-field:nth-of-type(2) {
    min-height: 0px;

    flex: 1 1 auto;
  }
}

#reviewWorkspaceView .review-page-title h2 {
  margin: 0px;

  color: var(--review-ink);

  font-size: var(--font-size-page-title);

  font-weight: var(--font-weight-semibold);
}

#reviewWorkspaceView .review-page-title .section-subtitle {
  overflow: hidden;

  color: var(--review-faint);

  text-overflow: ellipsis;

  white-space: nowrap;

  font-size: var(--font-size-caption);
}

#reviewWorkspaceView .review-card-heading {
  display: flex;

  align-items: center;

  gap: 9px;

  border-bottom: 1px solid var(--review-line-soft);

  background: var(--surface);

  min-height: 48px;

  padding: 10px 14px;
}

#reviewWorkspaceView .review-card-heading h3 {
  margin: 0px;

  color: var(--review-ink);

  font-size: var(--font-size-card-title);

  font-weight: var(--font-weight-semibold);
}

#reviewWorkspaceView .review-add-watch {
  min-height: 32px;

  display: inline-flex;

  align-items: center;

  gap: 5px;

  margin-left: auto;

  padding: 0px 10px;

  border: 1px solid var(--color-action-line);

  border-radius: 8px;

  background: var(--action-soft);

  color: var(--review-blue);

  font-size: var(--font-size-label);

  font-weight: var(--font-weight-semibold);
}

#reviewWorkspaceView .review-add-watch:hover {
  border-color: var(--action);

  background: var(--selected);
}

#reviewWorkspaceView .review-add-watch .lucide {
  width: 13px;

  height: 13px;
}

#reviewWorkspaceView .watchlist-section .workspace-table-frame {
  min-height: 0px;

  overflow: auto;

  border: 0px;

  border-radius: 0px;

  max-height: 220px;
}

#reviewWorkspaceView .review-watchlist-table th:nth-child(1) {
  width: 6%;
}

#reviewWorkspaceView .review-watchlist-table th:nth-child(2) {
  width: 16%;
}

#reviewWorkspaceView .review-watchlist-table th:nth-child(3) {
  width: 13%;
}

#reviewWorkspaceView .review-watchlist-table th:nth-child(4),
#reviewWorkspaceView .review-watchlist-table th:nth-child(5) {
  width: 10%;
}

#reviewWorkspaceView .review-watchlist-table th:nth-child(6) {
  width: 11%;
}

#reviewWorkspaceView .review-watchlist-table th:nth-child(7) {
  width: 22%;
}

#reviewWorkspaceView .review-watchlist-table th:nth-child(8) {
  width: 12%;
}

#reviewWorkspaceView .review-watchlist-table td {
  overflow: hidden;
}

#reviewWorkspaceView .review-watchlist-table .stock-cell strong {
  font-size: var(--font-size-table);

  font-weight: var(--font-weight-semibold);
}

#reviewWorkspaceView .review-watchlist-table .stock-cell small {
  font-size: var(--font-size-aux);
}

#reviewWorkspaceView .watch-attention-score {
  color: var(--text-primary);

  font-size: 12px;

  font-weight: 720;
}

#reviewWorkspaceView .watch-remark {
  display: block;

  overflow: hidden;

  color: var(--review-sub);

  font-size: 11.5px;

  text-overflow: ellipsis;

  white-space: nowrap;
}

#reviewWorkspaceView .journal-summary-field input {
  width: 100%;

  min-height: 38px;

  padding: 0px 11px;

  border: 1px solid var(--review-line);

  border-radius: 7px;

  outline: 0px;

  background: var(--surface);

  color: var(--review-ink);

  font-style: inherit;

  font-variant: inherit;

  font-weight: inherit;

  font-stretch: inherit;

  line-height: inherit;

  font-family: inherit;

  font-optical-sizing: inherit;

  font-size-adjust: inherit;

  font-kerning: inherit;

  font-feature-settings: inherit;

  font-variation-settings: inherit;

  font-language-override: inherit;

  font-size: 12.5px;
}

#reviewWorkspaceView .journal-summary-field input:focus {
  border-color: var(--review-blue-line);

  box-shadow: 0 0 0 2px var(--focus-ring);
}

#reviewWorkspaceView .journal-summary-field input::placeholder {
  color: var(--text-tertiary);
}

#reviewWorkspaceView .journal-form textarea {
  width: 100%;

  padding: 10px 11px;

  border: 1px solid var(--review-line);

  border-radius: 8px;

  outline: 0px;

  background: var(--surface);

  color: var(--review-ink);

  font-style: inherit;

  font-variant: inherit;

  font-weight: inherit;

  font-stretch: inherit;

  font-family: inherit;

  font-optical-sizing: inherit;

  font-size-adjust: inherit;

  font-kerning: inherit;

  font-feature-settings: inherit;

  font-variation-settings: inherit;

  font-language-override: inherit;

  font-size: 12.5px;

  line-height: 1.75;

  height: 154px;

  min-height: 112px;

  resize: none;
}

#reviewWorkspaceView .journal-form .form-field:nth-of-type(3) textarea {
  height: 92px;

  min-height: 82px;
}

#reviewWorkspaceView .journal-form-hint {
  margin: auto 0px 0px;

  color: var(--review-faint);

  line-height: 1.5;

  font-size: 10px;
}

.watchlist-dialog {
  width: min(520px, -28px + 100vw);
}

.watchlist-editor-form {
  display: grid;

  gap: 14px;

  padding: 16px 18px 18px;
}

.watchlist-editor-form .form-field {
  display: grid;

  gap: 7px;
}

.watchlist-editor-form .form-field > label,
.watchlist-editor-form .form-field > span {
  color: var(--text-secondary);

  font-size: 12px;

  font-weight: 650;
}

.watchlist-search-control {
  min-height: 40px;

  display: flex;

  align-items: center;

  gap: 8px;

  padding: 0px 11px;

  border: 1px solid var(--border-strong);

  border-radius: 8px;

  background: var(--surface);
}

.watchlist-search-control:focus-within {
  border-color: var(--color-action-line);

  box-shadow: 0 0 0 3px var(--focus-ring);
}

.watchlist-search-control .lucide {
  width: 15px;

  height: 15px;

  color: var(--text-tertiary);
}

.watchlist-search-control input {
  min-width: 0px;

  flex: 1 1 0%;

  border: 0px;

  outline: 0px;

  color: var(--text-primary);

  font-style: inherit;

  font-variant: inherit;

  font-weight: inherit;

  font-stretch: inherit;

  line-height: inherit;

  font-family: inherit;

  font-optical-sizing: inherit;

  font-size-adjust: inherit;

  font-kerning: inherit;

  font-feature-settings: inherit;

  font-variation-settings: inherit;

  font-language-override: inherit;

  font-size: 13px;
}

.watchlist-search-results {
  max-height: 230px;

  display: grid;

  overflow-y: auto;

  border-radius: 8px;
}

.watchlist-search-results button {
  min-height: 48px;

  display: flex;

  align-items: center;

  gap: 12px;

  padding: 7px 10px;

  border-width: 0px 0px 1px;

  border-style: none none solid;

  border-color: currentcolor currentcolor var(--border);

  border-image: none;

  background: var(--surface);

  color: var(--text-primary);

  text-align: left;
}

.watchlist-search-results button:hover {
  background: var(--surface-selected);
}

.watchlist-search-results button > span {
  min-width: 0px;

  display: grid;

  gap: 2px;
}

.watchlist-search-results button strong {
  font-size: 12.5px;
}

.watchlist-search-results button small {
  color: var(--text-tertiary);

  font-size: 10.5px;
}

.watchlist-search-results button > b {
  margin-left: auto;

  color: var(--text-secondary);

  font-size: 11px;

  font-weight: 560;
}

.watchlist-search-status {
  padding: 14px 10px;

  color: var(--text-tertiary);

  font-size: 11.5px;

  text-align: center;
}

.watchlist-selection {
  min-height: 62px;

  display: flex;

  align-items: center;

  gap: 11px;

  padding: 10px 12px;

  border: 1px solid var(--action-soft);

  border-radius: 8px;

  background: var(--surface-subtle);
}

.watchlist-selection[hidden] {
  display: none;
}

.watchlist-selection-icon {
  width: 34px;

  height: 34px;

  display: grid;

  flex: 0 0 auto;

  place-items: center;

  border-radius: 7px;

  background: var(--action-soft);

  color: var(--action);
}

.watchlist-selection-icon .lucide {
  width: 17px;

  height: 17px;
}

.watchlist-selection > div {
  min-width: 0px;

  display: grid;

  gap: 3px;
}

.watchlist-selection strong {
  color: var(--text-primary);

  font-size: 13.5px;
}

.watchlist-selection span {
  display: flex;

  gap: 8px;

  color: var(--text-tertiary);

  font-size: 10.5px;
}

.watchlist-selection span b {
  color: var(--text-secondary);

  font-weight: 600;
}

.watchlist-selection span i {
  font-style: normal;
}

.watchlist-selection .table-action {
  margin-left: auto;
}

.watchlist-editor-form textarea {
  width: 100%;

  min-height: 92px;

  padding: 9px 10px;

  resize: vertical;

  border: 1px solid var(--border-strong);

  border-radius: 8px;

  outline: 0px;

  font-style: inherit;

  font-variant: inherit;

  font-weight: inherit;

  font-stretch: inherit;

  font-family: inherit;

  font-optical-sizing: inherit;

  font-size-adjust: inherit;

  font-kerning: inherit;

  font-feature-settings: inherit;

  font-variation-settings: inherit;

  font-language-override: inherit;

  font-size: 12.5px;

  line-height: 1.65;
}

.watchlist-editor-form textarea:focus {
  border-color: var(--color-action-line);

  box-shadow: 0 0 0 3px var(--focus-ring);
}

#reviewWorkspaceView .trade-log-table th:nth-child(1) {
  width: 11%;
}

#reviewWorkspaceView .trade-log-table th:nth-child(2) {
  width: 17%;
}

#reviewWorkspaceView .trade-log-table th:nth-child(3) {
  width: 9%;
}

#reviewWorkspaceView .trade-log-table th:nth-child(4) {
  width: 14%;
}

#reviewWorkspaceView .trade-log-table th:nth-child(5) {
  width: 15%;
}

#reviewWorkspaceView .trade-log-table th:nth-child(6) {
  width: 23%;
}

#reviewWorkspaceView .trade-log-table th:nth-child(7) {
  width: 11%;
}

#reviewWorkspaceView .journal-form .form-field {
  min-height: 0px;

  display: flex;

  flex-direction: column;

  gap: 6px;
}

#reviewWorkspaceView .journal-form .form-field > span {
  color: var(--review-sub);

  font-size: 12px;

  font-weight: var(--font-weight-semibold);

  min-height: 0px;

  flex: 0 0 auto;

  line-height: 18px;
}

@media (min-width: 901px) {
  #reviewWorkspaceView .journal-form .form-field:nth-of-type(2) textarea {
    min-height: 112px;

    height: auto;

    flex: 1 1 auto;
  }
}

@media (max-width: 900px) {
  #reviewWorkspaceView .journal-section {
    width: 100%;

    height: auto;
  }

  #reviewWorkspaceView .review-left-stack {
    height: auto;
  }

  #reviewWorkspaceView .trade-log-table-frame {
    max-height: 360px;
  }
}

@media (max-width: 767px) {
  #reviewWorkspaceView .review-watchlist-table {
    min-width: 760px;
  }

  #reviewWorkspaceView .journal-form textarea {
    height: 150px;

    min-height: 120px;
  }

  #reviewWorkspaceView .journal-form .form-field:nth-of-type(3) textarea {
    height: 96px;

    min-height: 96px;
  }
}

.settings-dialog.trade-log-dialog {
  width: min(880px, -28px + 100vw);

  max-height: min(760px, -28px + 100dvh);
}

.trade-log-dialog .trade-log-form {
  border: 0px;

  padding: 18px 20px 20px;

  background: var(--surface-subtle);
}

.trade-log-dialog .trade-log-form-grid {
  grid-template-columns: repeat(4, minmax(0px, 1fr));

  gap: 11px;
}

.trade-log-dialog .trade-tags-field {
  grid-column: span 2;
}

.trade-log-dialog .trade-log-text-grid {
  gap: 11px;

  margin-top: 11px;
}

.trade-log-dialog .trade-log-text-grid textarea {
  min-height: 92px;
}

.settings-dialog.watchlist-dialog {
  width: min(500px, -28px + 100vw);
}

.watchlist-dialog .watchlist-editor-form {
  padding: 16px 18px 18px;
}

@media (max-width: 760px) {
  .trade-log-dialog .trade-log-form-grid,
  .trade-log-dialog .trade-log-text-grid {
    grid-template-columns: 1fr;
  }

  .trade-log-dialog .trade-tags-field {
    grid-column: auto;
  }
}

.search {
  display: flex;

  align-items: center;

  gap: 6px;

  border: 1px solid var(--line);

  border-radius: 7px;

  padding: 5px 10px;

  background: var(--surface);
}

.search .ico {
  color: var(--faint);
}

.review-grid {
  display: grid;

  grid-template-columns: minmax(0px, 1fr) 360px;

  gap: 12px;

  align-items: start;
}

#reviewWorkspaceView .review-watchlist-table {
  width: 100%;

  table-layout: auto;

  min-width: var(--table-compact);
}

#reviewWorkspaceView .trade-log-table {
  width: 100%;

  table-layout: auto;

  min-width: var(--table-medium);
}

#reviewWorkspaceView .review-watchlist-table th,
#reviewWorkspaceView .trade-log-table th {
  width: auto;
}

#reviewWorkspaceView :is(.review-watchlist-table, .trade-log-table) th:nth-child(2) {
  width: var(--col-stock);
}

#reviewWorkspaceView :is(.review-watchlist-table, .trade-log-table) th.number {
  width: var(--col-number);
}

#reviewWorkspaceView .trade-log-table th:first-child {
  width: var(--col-date);
}

#reviewWorkspaceView :is(.review-watchlist-table, .trade-log-table) th:last-child {
  width: var(--col-action);
}

#reviewWorkspaceView .review-watchlist-table th:nth-last-child(2),
#reviewWorkspaceView .trade-log-table th:nth-last-child(2) {
  width: auto;

  min-width: var(--col-text);
}

#reviewWorkspaceView :is(.watch-remark, .trade-copy) {
  white-space: normal;
}

@media (min-width: 768px) {
  :root #reviewWorkspaceView.active-view {
    height: auto;

    min-height: 0px;

    display: block;

    overflow: visible;
  }
}

:root[data-theme="dark"] :is(.global-search-results, .assistant-messages, .trade-log-form, .alerts-toolbar, .admin-section-picker) {
  border-color: var(--line-soft);

  background: var(--surface-muted);
}

:root[data-theme="dark"] #reviewWorkspaceView {
  --review-blue: var(--action);

  --review-blue-dark: var(--action-hover);

  --review-blue-soft: var(--action-soft);

  --review-blue-line: var(--blue-line);

  --review-line: var(--border);

  --review-line-soft: var(--line-soft);

  --review-ink: var(--text-primary);

  --review-sub: var(--text-secondary);

  --review-faint: var(--text-tertiary);
}

:root[data-theme="dark"] #reviewWorkspaceView :is(.review-history-toggle, .review-card-heading, .review-count-tag, .review-add-watch, .trade-log-summary, .workspace-table-frame thead th) {
  border-color: var(--border);

  background: var(--surface-muted);

  color: var(--text-secondary);
}

:root[data-theme="dark"] #reviewWorkspaceView .review-add-watch {
  border-color: var(--blue-line);

  background: var(--action-soft);

  color: var(--action);
}

:root[data-theme="dark"] #reviewWorkspaceView :is(thead th, tbody td) {
  border-color: var(--line-soft);

  background-color: transparent !important;
}

:root[data-theme="dark"] #reviewWorkspaceView thead th {
  background-color: var(--surface-muted) !important;

  color: var(--text-secondary);
}

:root[data-theme="dark"] #reviewWorkspaceView :is(.journal-form, .journal-form input, .journal-form textarea, #journalDate) {
  border-color: var(--border);

  background: var(--surface);

  color: var(--text-primary);
}

:root[data-theme="dark"] #reviewWorkspaceView :is(.notes-history-section, .notes-history) {
  border-color: var(--border);

  background: var(--surface);

  color: var(--text-primary);
}

:root[data-theme="dark"] :is(.watchlist-search-control, .watchlist-search-results, .watchlist-search-results button, .watchlist-selection) {
  border-color: var(--border);

  background: var(--surface);

  color: var(--text-primary);
}

:root[data-theme="dark"] .watchlist-search-control:focus-within {
  border-color: var(--blue-line);

  box-shadow: var(--control-shadow);
}

:root[data-theme="dark"] .watchlist-search-results button:hover {
  background: var(--action-soft);
}

:root[data-theme="dark"] #reviewWorkspaceView .data-table tbody tr:hover,
:root[data-theme="dark"] #reviewWorkspaceView .data-table tbody tr:hover td {
  color: var(--text-primary);

  background: var(--action-soft) !important;
}

:root[data-theme="dark"] #reviewWorkspaceView .data-table tbody td {
  color: var(--text-primary);
}

/* Mobile review is a single vertical workflow with locally horizontal tables. */
@media (max-width: 767px) {
  body.mobile-shell #reviewWorkspaceView {
    padding-inline: 0;
  }

  body.mobile-shell #reviewWorkspaceView .review-workspace,
  body.mobile-shell #reviewWorkspaceView .review-grid,
  body.mobile-shell #reviewWorkspaceView .review-left-stack {
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
  }

  body.mobile-shell #reviewWorkspaceView :is(.workspace-table-frame, .trade-log-table-frame) {
    min-height: 0;
    max-height: none;
    overflow-x: auto;
    overflow-y: visible;
  }

  body.mobile-shell #reviewWorkspaceView :is(.notes-history-section, .notes-history) {
    max-height: none;
    overflow: visible;
  }

  body.mobile-shell #reviewWorkspaceView .journal-section {
    width: 100%;
    height: auto;
  }
}

#reviewWorkspaceView .data-table thead th:first-child,
#reviewWorkspaceView .data-table tbody td:first-child {
  text-align: left;
}
