#view-dashboard [data-layout-group="metrics"] {
  gap: 10px;
  padding-block: 7px 17px;
  border-bottom-color: color-mix(in srgb, var(--text) 12%, transparent);
}
#view-dashboard [data-layout-group="metrics"] > .card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--text) 5%, transparent), transparent);
  border-radius: 8px;
  padding-block: 14px;
}
#view-dashboard [data-layout-group="metrics"] .stat-label { letter-spacing: 0; font-weight: 700; }
#view-dashboard [data-layout-group="metrics"] .stat-value { font-size: 26px; line-height: 1.15; letter-spacing: 0; overflow-wrap: anywhere; }
#view-dashboard [data-layout-group="metrics"] .bar-track { height: 4px; margin-block: 10px; background: color-mix(in srgb, var(--text) 12%, transparent); }
#view-dashboard [data-layout-group="metrics"] .bar-fill-win { background: linear-gradient(90deg, color-mix(in srgb, var(--profit) 56%, transparent), var(--profit)); }
#view-dashboard [data-layout-group="metrics"] .bar-fill-loss { background: linear-gradient(90deg, var(--loss), color-mix(in srgb, var(--loss) 58%, transparent)); }

#view-dashboard .dashboard-widget-grid > .dashboard-news {
  --ff-surface: #1b1b1d;
  --ff-rule: #ffffff12;
  --ff-hover: #ffffff0b;
  grid-row: span 5;
  min-height: 0;
  gap: 5px;
  container-type: inline-size;
  background: var(--ff-surface);
  border: 1px solid var(--ff-rule);
  border-radius: 8px;
  padding: 9px 11px 8px;
}
body.light-mode #view-dashboard .dashboard-widget-grid > .dashboard-news {
  --ff-surface: #fafafb;
  --ff-rule: #19192418;
  --ff-hover: #19192409;
}
.ff-header,.ff-heading,.ff-actions,.ff-date-nav,.ff-date-nav>div,.ff-footer,.ff-legend {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
}
.ff-header,.ff-date-nav,.ff-footer { justify-content: space-between; }
.ff-heading { gap: 7px; }
.ff-header h2 { margin: 0; font-size: 13px; letter-spacing: 0; }
.ff-header a,#ffTimezone,.ff-summary,.ff-legend { color: var(--muted); font-size: 10px; }
.ff-header a { white-space: nowrap; }
.ff-header a:hover,.ff-empty a { color: var(--accent); }
.ff-actions { gap: 2px; }
.ff-segments { display: inline-flex; gap: 2px; background: var(--ff-hover); padding: 2px; border-radius: 7px; }
.ff-segments button,.ff-control {
  display: inline-flex; justify-content: center; align-items: center; gap: 4px;
  min-width: 28px; min-height: 30px; padding: 4px 6px; border: 0; border-radius: 6px;
  background: none; color: var(--muted); font-family: inherit; font-size: 11px; font-weight: 650; cursor: pointer;
}
.ff-segments button { min-height: 25px; }
.ff-segments button[aria-pressed=true],.ff-control:hover:not(:disabled),.ff-control[aria-expanded=true] {
  background: var(--ff-hover,color-mix(in srgb,var(--text) 8%,transparent)); color: var(--text);
}
.ff-segments button[aria-pressed=true] { box-shadow: inset 0 1px var(--ff-rule), 0 1px 3px #0003; }
.ff-control:disabled { opacity: .4; cursor: default; }
.ff-control[hidden],.ff-filters[hidden] { display: none; }
.ff-control svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ff-date-nav { padding: 2px 0 4px; }
.ff-date-nav strong { font-size: 12px; min-width: 87px; text-align: center; font-weight: 750; }
.ff-filters {
  position: absolute;
  z-index: 4;
  inset: 46px 7px auto;
  max-height: calc(100% - 55px);
  overflow: auto;
  display: grid;
  gap: 9px;
  padding: 11px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 24px #0005;
}
.ff-filters fieldset { margin: 0; padding: 0; min-width: 0; border: 0; }
.ff-filters legend,.ff-search { font-size: 11px; font-weight: 700; color: var(--muted); }
.ff-filters fieldset>div,.ff-filter-footer { display: flex; gap: 4px; flex-wrap: wrap; }
.ff-filter-footer { justify-content: space-between; }
#ffFilterDone { background: var(--ff-hover); color: var(--text); }
.ff-option { display: inline-flex; gap: 4px; align-items: center; min-height: 26px; padding-inline: 3px; font-size: 11px; cursor: pointer; }
.ff-option input { accent-color: var(--accent); }
.ff-search { display: grid; gap: 4px; }
.ff-search input { padding: 6px 8px; min-height: 30px; border: 1px solid var(--border); border-radius: 6px; color: var(--text); background: var(--ff-surface); }
.ff-events { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--ff-rule) transparent; }
.ff-events:focus-visible { outline: 1px solid var(--accent); outline-offset: 1px; }
.ff-timeline { position: relative; padding-left: 1px; }
.ff-timeline::before {
  content: ''; position: absolute; top: 16px; bottom: 16px; left: 5px; width: 1px; background: var(--ff-rule);
}
.ff-event { display: grid; grid-template-columns: 11px minmax(0,1fr); gap: 5px; align-items: center; }
.ff-marker {
  position: relative; width: 9px; height: 9px; border: 1.5px solid color-mix(in srgb,var(--text) 48%,transparent);
  border-radius: 50%; background: var(--ff-surface); justify-self: start;
}
.ff-event-next .ff-marker { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb,var(--accent) 17%,transparent); }
.ff-event-content {
  display: grid; grid-template-columns: 48px 17px 32px minmax(0,1fr) auto; align-items: center;
  gap: 6px; min-height: 34px; border-radius: 7px; padding: 4px 7px;
}
.ff-event-content:hover { background: var(--ff-hover); }
.ff-event-next .ff-event-content { background: color-mix(in srgb,var(--accent) 9%,var(--ff-surface)); }
.ff-event time,.ff-figures { font: 680 11px 'JetBrains Mono',monospace; font-variant-numeric: tabular-nums; }
.ff-ccy { justify-self: start; background: var(--ff-hover); border-radius: 6px; padding: 3px 5px; font-size: 10px; font-weight: 800; }
.ff-folder { display: inline-flex; align-items: center; width: 17px; flex: 0 0 17px; color: #a3a3b2; }
.ff-folder svg { width: 17px; height: 17px; display: block; }
.ff-impact-high { color: #ff5361; }
.ff-impact-medium { color: #ffad50; }
.ff-impact-low { color: #e5cb62; }
.ff-impact-scheduled { color: #a6bccd; }
body.light-mode .ff-impact-high { color: #bf273d; }
body.light-mode .ff-impact-medium { color: #a65b12; }
body.light-mode .ff-impact-low { color: #806606; }
body.light-mode .ff-impact-scheduled { color: #45647a; }
.ff-event-title { font-size: 12px; line-height: 1.3; overflow-wrap: anywhere; }
.ff-figures { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 2px 7px; font-size: 10px; color: var(--muted); }
.ff-figures abbr { text-decoration: none; }
.ff-day-heading { margin: 4px 0 2px; padding: 5px 7px; font-size: 11px; font-weight: 700; color: var(--muted); }
.ff-footer { padding-top: 6px; border-top: 1px solid var(--ff-rule); }
.ff-legend { gap: 7px; }
.ff-legend > span { display: inline-flex; align-items: center; gap: 3px; }
.ff-legend .ff-folder,.ff-legend .ff-folder svg { width: 12px; height: 12px; flex-basis: 12px; }
.ff-empty { color: var(--muted); margin: 0; padding: 8px 5px; font-size: 12px; }
.ff-empty .ff-control { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
@container (max-width: 440px) {
  .ff-event-content { grid-template-columns: 41px 17px 30px minmax(0,1fr); gap: 4px; padding-inline: 5px; }
  .ff-figures { grid-column: 4; justify-content: flex-start; }
}
@container (max-width: 325px) {
  .ff-header { align-items: flex-start; }
  .ff-actions { flex-basis: 100%; }
  .ff-filters { top: 72px; max-height: calc(100% - 80px); }
}
#view-dashboard .dashboard-widget-grid > .dashboard-widget-calendar { --dashboard-bottom-inset: 16px; padding-block-end: var(--dashboard-bottom-inset); }
#view-dashboard .dashboard-widget-grid > .dashboard-notes { --dashboard-bottom-inset: 16px; min-height: 0; padding-block: 12px calc(var(--dashboard-bottom-inset) + 2px); }
.dashboard-note-editor { display: grid; grid-template-rows: auto minmax(110px,1fr); flex: 1; min-height: 0; gap: 8px; }
.dashboard-note-header,.dashboard-note-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dashboard-note-header { justify-content: space-between; }
.dashboard-note-meta { margin-left: auto; justify-content: flex-end; }
.dashboard-note-header h2 { font-size: 17px; margin: 0; }
.dashboard-note-meta span { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
#dashboardNotesStatus:not(:empty) { padding-left: 7px; border-left: 1px solid var(--border); }
.dashboard-notes textarea {
  display: block; min-width: 0; width: 100%; min-height: 110px; resize: none;
  border: 1px solid var(--border); border-radius: 8px; background: color-mix(in srgb, var(--bg-deep) 93%, var(--text));
  padding: 11px; color: var(--text); font: inherit; font-size: 13px; line-height: 1.55;
}
.dashboard-notes textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 65%, transparent); outline-offset: -1px; }
@media (min-width: 761px) and (max-width: 1180px) {
  #view-dashboard .dashboard-widget-grid > .dashboard-news,
  #view-dashboard .dashboard-widget-grid > .dashboard-notes { grid-column: 1 / -1; }
  #view-dashboard .dashboard-widget-grid > .dashboard-notes { grid-row: span 3; }
}

#view-dashboard .cal-cell.has-entry {
  --tile-accent: rgb(var(--cal-tone,var(--accent-rgb)));
  --tile-face: #151619;
  --tile-base: #0c0d0f;
  --tile-highlight: #ffffff22;
  background: linear-gradient(158deg,color-mix(in srgb,var(--tile-accent) 21%,var(--tile-face)),var(--tile-base) 83%);
  border-color: color-mix(in srgb,var(--tile-accent) 39%,var(--tile-face));
  box-shadow: inset 0 1px var(--tile-highlight),inset 0 -3px #0006,0 3px 6px #0005;
}
body.light-mode #view-dashboard .cal-cell.has-entry {
  --tile-face: #fff;
  --tile-base: #f6f7f8;
  --tile-highlight: #fffd;
  box-shadow: inset 0 1px var(--tile-highlight),inset 0 -2px #10102015,0 3px 7px #1010201f;
}
#view-dashboard .cal-cell.has-entry:is(:hover,:focus-visible) {
  z-index: 2;
  border-color: var(--tile-accent);
  transform: translateY(-2px);
  box-shadow: inset 0 1px var(--tile-highlight),inset 0 -2px #0003,0 6px 12px #0004;
}
@media (prefers-reduced-motion: reduce) {
  #view-dashboard .cal-cell.has-entry:is(:hover,:focus-visible) { transform: none; transition: none; }
}

#view-reports { min-width: 0; padding: 6px 6px 30px; }
.reports-head,.equity-report-head,.report-breakdown-head {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.reports-head h1 { margin: 0; font-size: 30px; letter-spacing: 0; }
.reports-head p,.equity-report-head p { color: var(--muted); font-size: 12px; margin: 3px 0 0; }
.report-period,.report-breakdown .report-tabs {
  display: inline-flex; gap: 3px; flex-wrap: wrap; padding: 3px; margin: 0;
  background: color-mix(in srgb, var(--text) 7%, transparent); border-radius: 8px;
}
.report-period button,.report-breakdown .report-tab,.report-icon {
  background: transparent; border: 0; border-radius: 6px; padding: 7px 10px; color: var(--muted);
  font: inherit; font-size: 12px; font-weight: 750; min-height: 32px; cursor: pointer;
  transition: background .19s, color .19s;
}
.report-period button[aria-pressed=true],.report-breakdown .report-tab.active,.report-icon:hover:not(:disabled) {
  background: color-mix(in srgb, var(--text) 10%, transparent); color: var(--text);
}
.report-icon { display: inline-grid; min-width: 32px; place-items: center; padding: 5px; }
.report-icon[hidden] { display: none; }
.report-icon:disabled { opacity: .4; cursor: default; }
.report-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.report-overview {
  display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px;
  text-align: center; width: min(100%,580px); margin: 0 auto;
  padding-block: 11px 15px; border-top: 1px solid var(--border);
}
.report-net-pnl { text-align: center; padding: 12px 0 19px; color: var(--text); }
.report-net-pnl span { font-size: 13px; font-weight: 750; text-transform: uppercase; color: var(--muted); }
.report-net-pnl strong {
  display: block; font: 810 72px/1.12 'JetBrains Mono',monospace; letter-spacing: 0;
  margin-top: 5px; overflow-wrap: anywhere;
  text-shadow: 0 0 25px color-mix(in srgb,currentColor 25%,transparent);
}
.report-net-pnl strong.pos { color: var(--profit); }
.report-net-pnl strong.neg { color: var(--loss); }
.report-overview span,.report-equity-values span { font-size: 11px; color: var(--muted); font-weight: 650; }
.report-overview strong { display: block; margin-top: 4px; font: 770 21px 'JetBrains Mono',monospace; overflow-wrap: anywhere; }
.equity-report { padding-block: 11px 12px; }
.equity-report-head h2,.report-breakdown h2 { font-size: 17px; margin: 0; letter-spacing: 0; }
.report-equity-plot {
  margin: 8px 0; height: clamp(335px, 53dvh, 680px); overflow: clip; cursor: zoom-in;
  background: #000; border-radius: 8px; box-shadow: inset 0 0 0 1px #ffffff1c;
}
#equitySvg { display: block; width: 100%; height: 100%; color: #f6f6f7; }
.equity-grid { stroke: currentColor; stroke-opacity: .12; }
.equity-path { stroke: currentColor; stroke-width: 2.35; stroke-linejoin: round; stroke-linecap: round; fill: none; }
.equity-path.is-drawing {
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: equityLineDraw var(--equity-duration) cubic-bezier(.32,.64,.28,1) var(--equity-delay) both;
}
@keyframes equityLineDraw { to { stroke-dashoffset: 0; } }
.equity-reveal { animation: equityFade .43s ease-out var(--equity-delay) both; }
@keyframes equityFade { from { opacity: 0; } to { opacity: 1; } }
.equity-dot { fill: currentColor; }
.equity-active-line { stroke: currentColor; stroke-opacity: .38; stroke-dasharray: 3 5; }
.equity-active-dot { fill: currentColor; stroke: var(--accent); stroke-width: 2; }
.equity-axis,.equity-point-pnl { font: 650 11px 'JetBrains Mono',monospace; fill: #a6a6ae; }
.equity-point-pnl { fill: currentColor; }
.report-equity-inspector {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px;
  padding: 6px 0; border-top: 1px solid var(--border);
}
.report-equity-stepper,.report-equity-values { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.report-equity-stepper time { font-size: 12px; font-weight: 700; min-width: 88px; text-align: center; }
.report-equity-values { gap: 8px 18px; }
.report-equity-values b { margin-left: 3px; font: 750 13px 'JetBrains Mono',monospace; color: var(--text); }
.report-equity-values .pos { color: var(--profit); }.report-equity-values .neg { color: var(--loss); }
.report-equity-dialog {
  width: min(1450px,calc(100vw - 36px)); max-height: calc(100dvh - 36px);
  border: 1px solid var(--border); border-radius: 8px; padding: 12px 21px; overflow: auto;
  background: var(--bg-deep); color: var(--text); box-shadow: 0 24px 90px #0008;
}
.report-equity-dialog::backdrop { background: #0009; backdrop-filter: blur(6px); }
.report-equity-dialog .equity-report { padding-block: 6px; }
.report-equity-dialog .report-equity-plot { height: clamp(210px,68dvh,820px); cursor: crosshair; }
.report-breakdown { border-top: 1px solid var(--border); padding-top: 18px; margin-top: 13px; }
.report-breakdown .report-table-wrap { margin-top: 12px; border: 0; border-radius: 0; }
.report-breakdown table { min-width: 530px; }
.report-breakdown th,.report-breakdown td { padding: 10px 9px; }
.report-breakdown td button {
  border: 0; background: none; color: var(--text); font: inherit; font-weight: 760; padding: 0; text-align: left; cursor: pointer;
}
.report-breakdown td button:hover { text-decoration: underline; }
.report-breakdown .report-win-meter { display: block; width: 57px; height: 3px; background: color-mix(in srgb,var(--text) 12%,transparent); border-radius: 3px; margin-top: 5px; overflow: hidden; }
.report-win-meter i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.report-summary-empty { padding-block: 22px; color: var(--muted); }
@media (max-width: 760px) {
  #view-dashboard .dashboard-widget-grid > .dashboard-news { height: 385px; min-height: 0; }
  #view-dashboard .dashboard-widget-grid > .dashboard-notes { height: 245px; min-height: 0; }
  #view-reports { padding-inline: 0; }
  .report-net-pnl strong { font-size: 39px; }
  .report-overview strong { font-size: 16px; }
  .report-equity-plot { height: 295px; }
  .report-equity-dialog { width: calc(100vw - 18px); padding-inline: 10px; }
  .report-equity-dialog .report-equity-plot { height: 58dvh; }
}
@media (prefers-reduced-motion: reduce) {
  .equity-path.is-drawing { animation: none; stroke-dashoffset: 0; }
  .equity-reveal { animation: none; }
  .report-period button,.report-breakdown .report-tab,.report-icon { transition: none; }
}
