.pl-workspace-mast {
  padding: 22px 18px 24px;
  border-top: 5px solid #171616;
  border-bottom: 1px solid #d8d0c2;
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.98), rgba(248, 243, 234, 0.96)),
    linear-gradient(90deg, rgba(216, 208, 194, 0.18) 1px, transparent 1px),
    linear-gradient(rgba(216, 208, 194, 0.18) 1px, transparent 1px);
  background-size: auto, 26px 26px, 26px 26px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.pl-brandline {
  display: flex;
  justify-content: center;
  gap: 0;
  align-items: center;
}

.pl-brandline a {
  display: inline-flex;
  justify-content: center;
}

.pl-brandname {
  display: block;
  height: 165px;
  width: auto;
  max-width: min(360px, 82vw);
}

.pl-kicker {
  color: #6b655e;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pl-hero-copy {
  margin-top: 10px;
  text-align: center;
}

.pl-hero-copy h1 {
  margin: 0;
  color: #171616;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: clamp(2.6rem, 4.2vw, 4rem);
  line-height: 0.98;
  font-weight: 700;
  letter-spacing: 0;
}

.pl-subline {
  margin-top: 14px;
  margin-left: auto;
  margin-right: auto;
  max-width: 66ch;
  color: #6b655e;
  font-size: 1rem;
  line-height: 1.65;
}

.pl-hero-chips {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.pl-hero-chip {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border: 1px solid #d8d0c2;
  background: rgba(255, 253, 248, 0.92);
  color: #171616;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pl-workspace-tools {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #d8d0c2;
  background: rgba(255, 253, 248, 0.94);
}

.pl-workspace-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
  border-bottom: 1px solid #d8d0c2;
  padding-bottom: 10px;
}

.pl-workspace-copy {
  margin: 0;
  color: #6b655e;
  font-size: 0.84rem;
  line-height: 1.45;
  text-align: right;
}

.pl-workspace-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.pl-workspace-tool {
  display: grid;
  min-height: 86px;
  align-content: start;
  gap: 6px;
  padding: 12px;
  border: 1px solid #dcc7a1;
  background: #fffaf0;
  color: inherit;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.pl-workspace-tool:hover {
  transform: translateY(-1px);
  border-color: #cdb180;
  box-shadow: 0 10px 22px rgba(23, 22, 22, 0.08);
}

.pl-workspace-tool.active {
  border-color: #dcc7a1;
  background: #ead7b2;
  box-shadow: inset 0 0 0 1px #dcc7a1;
}

.pl-workspace-tool strong {
  color: #5e4212;
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pl-workspace-tool span {
  color: #6b655e;
  font-size: 0.8rem;
  line-height: 1.4;
}

.pl-account-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #d8d0c2;
  background: rgba(255, 253, 248, 0.94);
  color: #6b655e;
  font-size: 0.82rem;
}

.pl-account-bar a,
.pl-account-bar button,
.pl-account-bar select {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: 6px 9px;
  border: 1px solid #dcc7a1;
  background: #fffaf0;
  color: #5e4212;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

.pl-account-bar form {
  margin: 0;
}

.pl-plan-switcher {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.pl-plan-switcher select {
  min-width: 126px;
  text-transform: none;
  letter-spacing: 0;
  color: #171616;
  font-weight: 700;
}

.personal-ledger-shell {
  margin-top: 12px;
  max-width: 860px;
}

.personal-ledger-compact {
  max-width: none;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #d9c7a6;
  background: rgba(255, 249, 238, 0.92);
  box-shadow: 0 10px 24px rgba(45, 35, 20, 0.05);
}

.personal-ledger-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 6px;
  color: #5e4212;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.personal-ledger-heading span {
  color: #4b3107;
}

.personal-ledger-heading small {
  color: #6f675c;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.personal-ledger-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid rgba(216, 208, 194, 0.82);
  background: rgba(255, 250, 242, 0.86);
}

.personal-ledger-compact .personal-ledger-form {
  padding: 0;
  border: 0;
  background: transparent;
}

.personal-ledger-form label {
  display: grid;
  gap: 3px;
  margin: 0;
  color: #665e54;
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.personal-ledger-form select,
.personal-ledger-form input {
  width: 88px;
  min-height: 30px;
  padding: 5px 7px;
  border: 1px solid #d8d0c2;
  background: #fffaf2;
  color: #171412;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.personal-ledger-form input {
  width: 82px;
}

.personal-ledger-form .personal-ledger-hold-field {
  grid-template-columns: 112px;
}

.personal-ledger-form .personal-ledger-hold-field.is-custom {
  grid-template-columns: 112px 82px;
}

.personal-ledger-form .personal-ledger-hold-field span {
  grid-column: 1 / -1;
}

.personal-ledger-form .personal-ledger-hold-field select {
  width: 112px;
}

.personal-ledger-form .personal-ledger-hold-field input {
  width: 82px;
}

.personal-ledger-form button,
.personal-ledger-login,
.personal-ledger-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid #d5bd91;
  background: #f3e4c8;
  color: #6c3f00;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.personal-ledger-form .personal-ledger-primary {
  min-width: 178px;
  border-color: #b88c4c;
  background: #ead4a9;
  color: #4b3107;
}

.personal-ledger-form button:hover,
.personal-ledger-login:hover,
.personal-ledger-view:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(23, 22, 22, 0.08);
}

.personal-ledger-login {
  text-decoration: none;
}

.personal-ledger-view {
  background: #fffaf2;
  color: #5e4212;
  text-decoration: none;
}

.research-ledger-panel {
  margin-top: 14px;
  margin-bottom: 18px;
}

.research-ledger-panel .personal-ledger-shell {
  max-width: none;
}

.chart-card .personal-ledger-shell {
  margin-top: 14px;
}

.chart-card .personal-ledger-form {
  max-width: none;
}

.chart-card .action-links .button,
.record-grid .action-links .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 106px;
  min-height: 32px;
  color: #5e4212;
  background: #fffaf0;
  border-color: #dcc7a1;
  white-space: nowrap;
}

.chart-card .action-links .button:hover,
.record-grid .action-links .button:hover {
  background: #f3e4c8;
}

@media (max-width: 1120px) {
  .pl-workspace-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .pl-workspace-mast {
    padding: 16px 14px 18px;
  }

  .pl-brandname {
    height: 128px;
  }

  .pl-hero-copy h1 {
    font-size: clamp(2.2rem, 13vw, 3.25rem);
  }

  .pl-subline {
    font-size: 0.95rem;
  }

  .pl-workspace-head {
    display: grid;
  }

  .pl-workspace-copy {
    text-align: left;
  }

  .pl-workspace-grid {
    grid-template-columns: 1fr;
  }
}

/*
 * Canonical workspace visual system.
 *
 * This stylesheet is deliberately loaded after the legacy page styles and
 * clean_ui.css.  The aliases below let older desk components and the shared
 * workspace components use one visual language while semantic trade colors
 * remain owned by their page-level classes.
 */
:root {
  --pl-paper: #f5f0e7;
  --pl-surface: #fffdf8;
  --pl-surface-muted: #faf6ee;
  --pl-surface-raised: #fffefa;
  --pl-ink: #1d1a17;
  --pl-ink-soft: #3f3932;
  --pl-muted: #6d655c;
  --pl-line: #d8d0c2;
  --pl-line-strong: #c8baa3;
  --pl-accent: #624514;
  --pl-accent-soft: #ead9b8;
  --pl-accent-muted: #f5ead4;
  --pl-positive: #12664f;
  --pl-negative: #a23d28;
  --pl-ai: #315b8a;
  --pl-tracked: #14705a;
  --pl-weekly: #8a5a22;
  --pl-us: #6c3f00;
  --pl-hk: #8b3d72;
  --pl-shadow-sm: 0 8px 20px rgba(48, 38, 24, 0.045);
  --pl-shadow-md: 0 16px 36px rgba(48, 38, 24, 0.065);
  --pl-shell-width: 1500px;
  --pl-control-height: 38px;

  /* Legacy aliases keep page-specific layouts visually aligned. */
  --paper: var(--pl-paper);
  --card: var(--pl-surface);
  --surface: var(--pl-surface);
  --surface-strong: var(--pl-surface-raised);
  --ink: var(--pl-ink);
  --muted: var(--pl-muted);
  --line: var(--pl-line);
  --accent: var(--pl-accent);
  --accent-soft: var(--pl-accent-soft);
  --accent-border: var(--pl-line-strong);
  --button-line: var(--pl-line-strong);
  --button-surface: var(--pl-surface-muted);
  --button-tint: var(--pl-accent-muted);
  --good: var(--pl-positive);
  --bad: var(--pl-negative);
}

html {
  background: var(--pl-paper);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--pl-ink);
  background:
    radial-gradient(circle at 50% -12%, rgba(173, 136, 77, 0.11), transparent 34rem),
    linear-gradient(180deg, #faf7f1 0, var(--pl-paper) 38rem) !important;
  font-family: "Aptos", "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body > .shell,
.shell {
  width: min(var(--pl-shell-width), calc(100vw - 36px)) !important;
  margin: 18px auto 48px !important;
}

.app-frame {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

a,
button,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(137, 96, 30, 0.32);
  outline-offset: 2px;
}

/* Shared account, mast, and workspace navigation. */
.pl-account-bar,
.account-bar {
  min-height: 48px;
  margin: 0 0 12px;
  padding: 8px 10px !important;
  border: 1px solid var(--pl-line) !important;
  background: rgba(255, 253, 248, 0.94) !important;
  box-shadow: var(--pl-shadow-sm) !important;
  color: var(--pl-muted);
  font-size: 0.8rem;
}

.pl-account-bar a,
.pl-account-bar button,
.pl-account-bar select,
.account-bar a,
.account-bar button,
.account-bar select {
  min-height: 32px;
  border: 0.5px solid rgba(119, 104, 80, 0.34) !important;
  background: var(--pl-surface-muted) !important;
  color: var(--pl-accent) !important;
  box-shadow: none !important;
  font-size: 0.74rem;
  font-weight: 850;
}

.pl-workspace-mast,
.mast {
  padding: 18px 20px 22px;
  border: 1px solid var(--pl-line) !important;
  border-top: 4px solid var(--pl-ink) !important;
  background:
    linear-gradient(135deg, rgba(255, 254, 250, 0.98), rgba(248, 243, 234, 0.95)),
    linear-gradient(90deg, rgba(216, 208, 194, 0.14) 1px, transparent 1px),
    linear-gradient(rgba(216, 208, 194, 0.14) 1px, transparent 1px) !important;
  background-size: auto, 28px 28px, 28px 28px !important;
  box-shadow: var(--pl-shadow-sm) !important;
}

.pl-brandname,
.brandname {
  height: 132px;
  max-width: min(340px, 80vw);
}

.pl-hero-copy,
.hero-copy {
  margin-top: 6px;
  text-align: center;
}

.pl-hero-copy h1,
.mast .hero-copy h1 {
  max-width: 30ch;
  margin: 0 auto;
  color: var(--pl-ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: clamp(2.25rem, 3.8vw, 3.45rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.02;
  text-wrap: balance;
}

.pl-hero-copy h1.is-long {
  max-width: 32ch;
  font-size: clamp(2rem, 3.2vw, 3rem);
}

.pl-subline,
.subline {
  max-width: 72ch;
  margin: 12px auto 0;
  color: var(--pl-muted);
  font-size: 0.94rem;
  line-height: 1.58;
}

.pl-hero-chips,
.hero-chips {
  margin-top: 14px;
  gap: 7px;
}

.pl-hero-chip,
.hero-chip {
  min-height: 27px;
  padding: 4px 9px;
  border: 1px solid var(--pl-line) !important;
  background: rgba(255, 253, 248, 0.92) !important;
  color: var(--pl-ink-soft);
  font-size: 0.68rem;
  letter-spacing: 0.085em;
}

.pl-workspace-tools,
.workspace-tools {
  margin-top: 12px;
  padding: 12px !important;
  border: 1px solid var(--pl-line) !important;
  background: rgba(255, 253, 248, 0.94) !important;
  box-shadow: var(--pl-shadow-sm) !important;
}

.pl-workspace-head,
.workspace-head {
  min-height: 29px;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--pl-line) !important;
}

.pl-workspace-grid,
.workspace-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.pl-workspace-tool,
.workspace-tool {
  min-height: 90px;
  gap: 6px;
  padding: 11px 12px;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none;
}

.pl-workspace-tool:hover,
.workspace-tool:hover {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none;
}

.pl-workspace-tool.active,
.workspace-tool.active {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.pl-workspace-tool.active strong,
.workspace-tool.active strong {
  color: #3f2b0c;
}

.pl-workspace-tool.active span,
.workspace-tool.active span {
  color: #55432a;
}

.pl-workspace-tool strong,
.workspace-tool strong {
  color: var(--pl-accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.065em;
}

.pl-workspace-tool span,
.workspace-tool span {
  color: var(--pl-muted);
  font-size: 0.75rem;
  line-height: 1.42;
}

.pl-kicker,
.page-kicker,
.section-kicker,
.reference-body .kicker,
.report-head .kicker,
.field label,
.label {
  color: var(--pl-muted);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.105em;
  line-height: 1.25;
  text-transform: uppercase;
}

/* Neutral surfaces share one border, fill, and restrained elevation. */
.panel,
.section,
.command-bar,
.table-card,
.chart-card,
.support-chart,
.composite-section,
.setup-group,
.backtest-hero,
.backtest-filter-panel,
.result-card,
.rule-card,
.record-card,
.empty-state {
  border-color: var(--pl-line) !important;
  background: rgba(255, 253, 248, 0.96) !important;
  box-shadow: var(--pl-shadow-sm) !important;
}

.panel,
.section,
.command-bar,
.backtest-hero,
.backtest-filter-panel,
.reference-body {
  margin-top: 16px;
}

.content {
  padding: 18px !important;
}

.panel {
  padding: 18px;
}

/* Sections use the same visible surface treatment as panels, so their headings
   and first child cards need the same deliberate inset from the frame. */
.section {
  padding: 18px;
}

.section-head,
.section-bar,
.composite-section-title,
.support-chart-title,
.chart-head,
.record-head,
.result-head,
thead,
tr,
td,
th {
  border-color: rgba(119, 104, 80, 0.2) !important;
}

.section-title,
.evidence-section-head h2,
.reference-body .section-head h2,
.report-head h2,
.command-bar .page-title {
  margin: 3px 0 0;
  color: var(--pl-ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.12;
}

/* Compact titles for nested cards and data groups. These remain distinct from
   full section headings so narrow rails do not inherit oversized display type. */
.pl-card-title {
  margin: 0;
  color: var(--pl-ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  line-height: 1.18;
  text-transform: none;
  text-wrap: balance;
}

.pl-data-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  margin: 0;
  color: var(--pl-ink-soft);
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.25;
  text-transform: none;
}

.pl-data-heading > span + span::before {
  content: "\00b7";
  margin: 0 6px;
  color: var(--pl-line-strong);
  font-family: "Aptos", "Segoe UI", Arial, sans-serif;
}

.pl-data-heading .pl-market-code {
  color: var(--pl-accent);
  font-family: "Aptos", "Segoe UI", Arial, sans-serif;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pl-data-heading .pl-data-date {
  color: var(--pl-muted);
  font-family: "Aptos", "Segoe UI", Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.015em;
}

.section-copy,
.copy,
.evidence-section-head p,
.reference-body .section-copy {
  color: var(--pl-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.reference-body .section-head,
.report-head,
.evidence-section-head,
.page-title-row {
  gap: 20px;
  align-items: flex-end;
}

.reference-body .section-head {
  display: flex;
  justify-content: space-between;
}

.reference-body .section-head > :first-child {
  flex: 1 1 320px;
}

.reference-body .section-head .section-copy {
  flex: 1 1 620px;
  max-width: 76ch;
  margin-top: 0;
}

.backtest-hero {
  gap: 26px;
  padding: 24px;
}

.backtest-hero h1 {
  margin: 5px 0 9px;
  color: var(--pl-ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: clamp(1.75rem, 3vw, 2.45rem);
  letter-spacing: -0.02em;
  line-height: 1.08;
}

.backtest-scope,
.backtest-note,
.method-strip,
.history-method {
  border-color: var(--pl-line) !important;
  background: var(--pl-surface-muted) !important;
  box-shadow: none !important;
}

.method-step,
.horizon-cell,
.result-foot {
  border-color: rgba(119, 104, 80, 0.18) !important;
}

.metric,
.stat {
  border: 1px solid rgba(119, 104, 80, 0.14) !important;
  background: var(--pl-surface-muted) !important;
  box-shadow: none !important;
}

/* Controls and tabs use one size; semantic badges keep their own colors. */
.button,
.btn,
.tabs a,
.nav a,
.filters a,
.trade-ribbon a,
.field > button,
.review-request-form button,
.sample-plan-card button,
.personal-ledger-form button,
select,
input:not([type="hidden"]) {
  min-height: var(--pl-control-height);
  border: 0.5px solid rgba(119, 104, 80, 0.34) !important;
  border-radius: 2px;
  background: var(--pl-surface-muted) !important;
  color: var(--pl-ink-soft) !important;
  box-shadow: none !important;
  font-family: inherit;
  font-size: 0.82rem;
  line-height: 1.2;
}

.button,
.btn,
.tabs a,
.nav a,
.filters a,
.trade-ribbon a,
.field > button,
.review-request-form button,
.sample-plan-card button,
.personal-ledger-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button:hover,
.btn:hover,
.tabs a:hover,
.nav a:hover,
.filters a:hover,
.trade-ribbon a:hover,
.field > button:hover,
.review-request-form button:hover {
  border-color: #ad8d5b !important;
  background: var(--pl-surface-raised) !important;
  box-shadow: var(--pl-shadow-sm) !important;
  transform: translateY(-1px);
}

.button.primary,
.chart-link-internal,
.field > button,
.review-request-form button,
.sample-plan-card button {
  border-color: #b89359 !important;
  background: var(--pl-accent-muted) !important;
  color: var(--pl-accent) !important;
}

/* Internal and external chart actions are peers, so they share one surface. */
.button.chart-link-internal,
.button.chart-link-external,
.chart-link-internal,
.chart-link-external {
  border: 0.5px solid rgba(119, 104, 80, 0.34) !important;
  background: var(--pl-surface-muted) !important;
  color: var(--pl-accent) !important;
  box-shadow: none !important;
}

.button.chart-link-internal:hover,
.button.chart-link-external:hover,
.chart-link-internal:hover,
.chart-link-external:hover {
  border-color: rgba(129, 99, 51, 0.44) !important;
  background: var(--pl-surface-raised) !important;
}

.tabs a.active,
.nav a.active,
.filters a.active,
.trade-ribbon a.active,
.segment-tab.active {
  border-color: #b69055 !important;
  background: var(--pl-accent-soft) !important;
  color: var(--pl-accent) !important;
  box-shadow: none !important;
}

.journal-view-tabs {
  gap: 8px;
  margin: 16px 0;
}

.journal-view-tabs a {
  min-height: 46px;
  border-color: var(--pl-line-strong) !important;
  background: var(--pl-surface-muted) !important;
  color: var(--pl-ink-soft) !important;
  font-size: 0.76rem;
}

.journal-view-tabs a.active {
  border-color: #b69055 !important;
  background: var(--pl-accent-soft) !important;
  color: var(--pl-accent) !important;
  box-shadow: none !important;
}

.delete-button {
  border-color: rgba(162, 61, 40, 0.38) !important;
  background: #fff3ef !important;
  color: #8b2418 !important;
}

input::placeholder {
  color: #8c847a;
  opacity: 1;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

/* Data density and alignment. */
.table-wrap,
.journal-table-scroll,
.pnl-chart-wrap {
  scrollbar-color: #c7b99f transparent;
  scrollbar-gutter: stable;
}

table {
  border-collapse: collapse;
  color: var(--pl-ink-soft);
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}

thead th {
  background: var(--pl-surface-muted) !important;
  color: var(--pl-muted);
  font-size: 0.69rem;
  font-weight: 900;
  letter-spacing: 0.075em;
  line-height: 1.3;
  text-transform: uppercase;
}

tbody tr {
  border-color: rgba(119, 104, 80, 0.14) !important;
}

tbody tr:hover {
  background: rgba(238, 224, 196, 0.22);
}

th,
td {
  padding-block: 10px;
}

.journal-guide,
.journal-mode-banner,
.ledger-summary-card,
.pnl-panel {
  border-radius: 2px;
}

.ledger-summary-card-compact span,
.ledger-source-badge {
  font-size: 0.68rem;
}

.ledger-summary-card-compact small {
  font-size: 0.68rem;
  line-height: 1.28;
}

.journal-guide,
.journal-mode-banner,
.pnl-panel {
  box-shadow: var(--pl-shadow-sm);
}

@media (max-width: 1240px) {
  .pl-workspace-grid,
  .workspace-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .pl-workspace-grid,
  .workspace-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reference-body .section-head,
  .report-head,
  .evidence-section-head,
  .page-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .reference-body .section-head {
    display: grid;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 14px;
  }

  body > .shell,
  .shell {
    width: min(var(--pl-shell-width), calc(100vw - 18px)) !important;
    margin-top: 9px !important;
    margin-bottom: 30px !important;
  }

  .content {
    padding: 12px !important;
  }

  .panel,
  .section,
  .backtest-hero,
  .backtest-filter-panel {
    padding: 15px;
  }

  .pl-account-bar,
  .account-bar {
    margin-bottom: 9px;
  }

  .pl-workspace-mast,
  .mast {
    padding: 14px 13px 17px;
  }

  .pl-brandname,
  .brandname {
    height: 112px;
  }

  .pl-hero-copy h1,
  .mast .hero-copy h1 {
    font-size: clamp(2rem, 10.5vw, 2.8rem);
  }

  .pl-subline,
  .subline {
    font-size: 0.88rem;
    line-height: 1.5;
  }

  .backtest-hero,
  .backtest-notes,
  .method-strip,
  .horizon-grid {
    grid-template-columns: 1fr !important;
  }

  .method-step,
  .horizon-cell {
    border-right: 0 !important;
    border-bottom: 1px solid rgba(119, 104, 80, 0.18) !important;
  }

  .method-step:last-child,
  .horizon-cell:last-child {
    border-bottom: 0 !important;
  }
}

@media (max-width: 560px) {
  .pl-workspace-grid,
  .workspace-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pl-workspace-tool,
  .workspace-tool {
    min-height: 62px;
    padding: 10px;
  }

  .pl-workspace-tool span,
  .workspace-tool span {
    display: none;
  }

  .journal-view-tabs a {
    min-height: 44px;
    padding-inline: 5px;
    font-size: 0.68rem;
  }

  .actions,
  .downloads,
  .history-actions {
    width: 100%;
  }

  .actions .button,
  .downloads .button,
  .history-actions .button,
  .history-actions .btn {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
