/*
 * Trading Journal — static visual mockup
 * Palette: cream, near-black, green (profits), red (losses).
 * No JavaScript or external dependencies.
 */
:root {
  --background: #f9f6f2;
  --ink: #151619;
  --ink-muted: #62615f;
  --line: #e5dfd9;
  --profit: #078a24;
  --loss: #d83e3c;
  --surface: rgba(255, 255, 255, 0.36);
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(ellipse 52% 17% at 71% -1%, rgba(226, 216, 208, .40) 0%, transparent 78%),
    radial-gradient(ellipse 47% 17% at 98% 5%, rgba(237, 224, 217, .32) 0%, transparent 82%),
    radial-gradient(ellipse 76% 60% at 6% 80%, rgba(241, 234, 227, .25), transparent 76%),
    var(--background);
}

.journal {
  width: min(100% - 78px, 1340px);
  margin: 0 auto;
  padding: 69px 0 63px;
}

.page-header { margin: 0 0 57px 19px; }

.page-header h1 {
  margin: 0;
  font-size: clamp(3.1rem, 5.4vw, 4.1rem);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.055em;
}

.disclaimer {
  display: flex;
  align-items: center;
  gap: 17px;
  margin: 18px 0 0;
  color: #383838;
  font-size: clamp(1rem, 2.3vw, 1.625rem);
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.info-icon { flex: none; color: #6d6d6b; }

.portfolio-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 20px 45px;
}

.summary-stat {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 0 60px;
  min-height: 99px;
}
.summary-stat:first-child { padding-left: 45px; }
.summary-stat + .summary-stat { border-left: 1px solid #d8d0c8; }

.summary-label {
  color: var(--ink-muted);
  font-size: clamp(1rem, 1.9vw, 1.375rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.summary-number {
  display: block;
  margin-top: 12px;
  font-size: clamp(1.7rem, 3.55vw, 2.625rem);
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 1.1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.gain { color: var(--profit); }
.loss { color: var(--loss); }

.trades { border-top: 1px solid #ddd6d0; padding-top: 49px; }

.trade-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.trade-card {
  display: grid;
  grid-template-columns: 52px 1px minmax(203px, 1fr) 63px minmax(280px, 1.4fr) 138px;
  column-gap: 22px;
  align-items: center;
  min-height: 108px;
  padding: 14px 25px 14px 36px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 5px 13px rgba(66, 50, 38, .025);
}

.trade-id {
  color: #827f7b;
  font-size: 1.7rem;
  font-weight: 720;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.trade-divider { display: block; width: 1px; height: 50px; background: #afa9a5; }

.trade-instrument { min-width: 0; }
.trade-instrument :is(h2, h3) {
  margin: 0 0 4px;
  font-size: 2rem;
  font-weight: 760;
  line-height: 1;
  letter-spacing: -0.04em;
  white-space: nowrap;
}
.trade-dates {
  display: block;
  color: #45413d;
  font-size: 1.13rem;
  line-height: 1.45;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.trade-quantity {
  font-size: 1.45rem;
  font-weight: 500;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.trade-prices {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 1.43rem;
  letter-spacing: -0.03em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.price-arrow { color: #77736f; font-size: 1.5rem; padding: 0 2px; }

.trade-return {
  font-size: 2.25rem;
  font-weight: 750;
  line-height: 1;
  letter-spacing: -0.045em;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.feed-more {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  padding: 55px 0 0;
}
.feed-more span { width: 6px; height: 6px; border-radius: 50%; background: #9b9490; }

@media (max-width: 1150px) {
  .summary-stat { padding-inline: 34px; }
  .summary-stat:first-child { padding-left: 18px; }
  .trade-card {
    grid-template-columns: 45px 1px minmax(177px, 1fr) 45px minmax(250px, 1.4fr) 100px;
    column-gap: 15px;
    padding-inline: 23px;
  }
  .trade-prices { font-size: 1.18rem; }
  .trade-dates { font-size: 1rem; }
  .trade-quantity { font-size: 1.27rem; }
  .trade-return { font-size: 1.9rem; }
}

@media (max-width: 918px) {
  .journal { width: min(100% - 40px, 680px); padding-top: 44px; }
  .page-header { margin-left: 0; margin-bottom: 44px; }
  .disclaimer { font-size: 1.06rem; gap: 12px; }
  .info-icon { width: 27px; height: 27px; }
  .portfolio-summary { margin: 0 0 37px; }
  .summary-stat { min-height: 78px; padding-inline: 20px; }
  .summary-stat:first-child { padding-left: 0; }
  .summary-label { font-size: .9rem; }
  .summary-number { font-size: clamp(1.25rem, 3.6vw, 1.8rem); }
  .trades { padding-top: 30px; }
  .trade-card {
    grid-template-columns: 46px 1px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 8px 14px;
    padding: 21px;
    min-height: 123px;
  }
  .trade-id { grid-column: 1; grid-row: 1; font-size: 1.35rem; }
  .trade-divider { grid-column: 2; grid-row: 1 / span 2; height: 100%; }
  .trade-instrument { grid-column: 3; grid-row: 1; }
  .trade-instrument :is(h2, h3) { font-size: 1.55rem; margin-bottom: 4px; }
  .trade-dates { font-size: .9rem; }
  .trade-quantity { grid-column: 1; grid-row: 2; font-size: 1rem; }
  .trade-prices { grid-column: 3 / 5; grid-row: 2; justify-content: flex-start; font-size: 1.04rem; gap: 12px; }
  .trade-return { grid-column: 4; grid-row: 1; font-size: 1.7rem; }
}

@media (max-width: 540px) {
  .journal { width: calc(100% - 30px); padding-top: 35px; }
  .page-header h1 { font-size: clamp(2.65rem, 9.3vw, 3.6rem); }
  .page-header { margin-bottom: 33px; }
  .disclaimer { align-items: flex-start; font-size: .97rem; line-height: 1.45; margin-top: 13px; }
  .portfolio-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 24px; }
  .summary-stat { min-height: 65px; padding-inline: 18px; }
  .summary-stat:nth-child(3) { border-left: none; padding-left: 0; }
  .summary-stat:nth-child(3) { grid-column: 1 / -1; }
  .summary-label { font-size: .87rem; }
  .summary-number { font-size: 1.55rem; margin-top: 8px; }
  .trade-card { grid-template-columns: 40px 1px minmax(0, 1fr) auto; gap: 10px 10px; padding: 17px 14px; border-radius: 17px; }
  .trade-id { font-size: 1.1rem; }
  .trade-instrument :is(h2, h3) { font-size: 1.43rem; }
  .trade-dates { font-size: .75rem; white-space: normal; }
  .trade-quantity { font-size: .88rem; }
  .trade-prices { font-size: .91rem; gap: 7px; letter-spacing: -0.04em; flex-wrap: wrap; }
  .price-arrow { font-size: 1rem; }
  .trade-return { font-size: 1.55rem; }
  .feed-more { padding-top: 37px; }
}

@media (max-width: 375px) {
  .trade-prices { font-size: .81rem; gap: 5px; }
  .trade-return { font-size: 1.35rem; }
  .trade-card { column-gap: 8px; }
}

/* Generated-page additions: preserve the original mockup's tokens and cards. */
.preview-notice, .journal-context, .summary-caption {
  color: var(--ink-muted);
  font-size: .95rem;
  line-height: 1.5;
}
.preview-notice { margin: 22px 0 0; font-weight: 650; color: var(--ink); }
.journal-context { margin: 8px 0 0; }
.journal-context a, .methodology a { color: inherit; text-underline-offset: 3px; }
.summary-caption { margin: -20px 20px 20px; }
.neutral { color: var(--ink-muted); }
.trade-state, .trade-detail {
  display: block;
  margin-top: 5px;
  color: var(--ink-muted);
  font-size: .8rem;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: normal;
}
.trade-card[data-position-id] .trade-instrument :is(h2, h3),
.trade-card[data-position-id] .trade-dates,
.trade-card[data-position-id] .trade-quantity,
.trade-card[data-position-id] .trade-return {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
.trade-card[data-position-id] .trade-prices {
  min-width: 0;
  flex-wrap: wrap;
  white-space: normal;
  overflow-wrap: anywhere;
}
.trade-entry, .trade-exits { min-width: 0; }
.trade-exits { display: flex; flex-direction: column; gap: 6px; }
.trade-exit-empty { color: var(--ink-muted); }
.return-amount { display: block; font-size: 1em; }
.methodology .page-header { margin-left: 0; }
.methodology .page-header h1 { font-size: clamp(2.4rem, 5.4vw, 4.1rem); overflow-wrap: anywhere; }
.methodology .page-header .journal-context { margin-bottom: 24px; }
.methodology-content { max-width: 760px; font-size: 1.05rem; line-height: 1.7; }
.methodology-content h2 { margin-top: 32px; font-size: 1.4rem; letter-spacing: -.025em; }
@media (max-width: 918px) {
  .summary-caption { margin-inline: 0; }
}

/* Polish journal: the original mockup remains a separate development reference. */
.journal--generated .page-header { margin-left: 0; margin-bottom: 28px; }
.subtitle { margin: 16px 0 0; color: var(--ink-muted); font-size: 1.1rem; line-height: 1.5; }
.journal--generated .disclaimer { align-items: flex-start; font-size: clamp(.95rem, 1.45vw, 1.1rem); line-height: 1.5; }
.journal--generated .trades { padding-top: 24px; }
.trade-history-title { margin: 0 0 20px; font-size: 1.15rem; font-weight: 600; letter-spacing: -.025em; }
.empty-state { margin: 0; color: var(--ink-muted); font-size: 1rem; line-height: 1.6; }
.journal--generated a:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 2px; }

/* TakeProfit.blog: shared navigation and visible risk copy, without changing cards. */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px 32px;
  margin: 0 0 40px;
}
.site-brand {
  color: var(--ink);
  font-size: clamp(2.185rem, 3.45vw, 2.875rem);
  font-weight: 800;
  letter-spacing: -.055em;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
}
.brand-accent { color: var(--profit); }
.site-nav { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.site-nav a, .blog-content a { color: var(--ink-muted); text-underline-offset: 5px; }
.site-nav a { font-size: .95rem; line-height: 1.5; text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }
.site-nav a:hover { text-decoration: underline; }
.journal--generated .page-header h1 { font-size: clamp(1.6rem, 3.4vw, 2.68rem); }
.journal--generated .investment-notice {
  margin-top: 26px;
  max-width: 980px;
  font-size: 1rem;
  line-height: 1.6;
  letter-spacing: normal;
}
.notice-copy { min-width: 0; }
.notice-copy p { margin: 0; }
.notice-copy p + p { margin-top: 10px; }
.journal--generated .investment-notice + .journal-context { margin-top: 20px; }
.journal--generated .preview-notice { margin: 0 0 24px; }
.blog .page-header { margin-left: 0; }
.blog-content { font-size: 1.05rem; line-height: 1.7; }
@media (max-width: 918px) {
  .site-header { margin-left: 0; margin-bottom: 32px; }
}
@media (max-width: 540px) {
  .site-header { gap: 20px; }
  .site-nav { width: 100%; gap: 12px 22px; }
  .journal--generated .page-header h1 { font-size: 1.64rem; line-height: 1.15; }
  .journal--generated .subtitle { font-size: 1rem; }
  .journal--generated .investment-notice { gap: 12px; font-size: .95rem; }
}

/* Exact execution-based reporting: quiet separators, no dashboard decoration. */
.year-selector { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 0 0 26px; }
.year-selector a { color: var(--ink-muted); font-size: .95rem; text-decoration: none; text-underline-offset: 5px; }
.year-selector a[aria-current="page"] { color: var(--ink); text-decoration: underline; }
.year-selector a:hover { text-decoration: underline; }
.reporting-year { margin: 0 0 26px; color: var(--ink); font-size: .95rem; line-height: 1.5; }
.statistics { margin: 0 0 26px; }
.statistics-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 16px; }
.statistics-grid > div { min-width: 0; padding: 0 24px; }
.statistics-grid > div:first-child { padding-left: 0; }
.statistics-grid > div + div { border-left: 1px solid var(--line); }
.statistics dt { color: var(--ink-muted); font-size: .88rem; line-height: 1.5; }
.statistics dd { margin: 10px 0 0; font-size: clamp(1.3rem, 2.4vw, 1.9rem); font-weight: 750; letter-spacing: -.04em; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.statistics-note { color: var(--ink-muted); font-size: .85rem; line-height: 1.6; }
.statistics-note { margin: 5px 0 0; }
.statistics-note a { color: inherit; text-underline-offset: 3px; }
.return-period { display: block; }
@media (max-width: 540px) {
  .statistics-grid { grid-template-columns: 1fr; gap: 16px; }
  .statistics-grid > div { padding: 0; }
  .statistics-grid > div + div { border-left: 0; border-top: 1px solid var(--line); padding-top: 16px; }
  .statistics dd { margin-top: 5px; font-size: 1.45rem; }
}

/* Editorial blog: scoped to .blog; the journal and its cards keep their existing styling. */
.blog { --editorial: Georgia, "Times New Roman", serif; }
.blog .page-header { margin-bottom: 0; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.blog.journal--generated .page-header h1 { font-family: var(--editorial); font-size: clamp(2.75rem, 5vw, 4rem); font-weight: 600; letter-spacing: -.055em; line-height: 1.1; }
.blog-subtitle { margin: 12px 0 0; color: #414140; font-size: clamp(1rem, 1.7vw, 1.3rem); line-height: 1.55; }
.blog-heading { margin: 0; font-family: var(--editorial); font-weight: 600; letter-spacing: -.035em; line-height: 1.12; overflow-wrap: anywhere; }
.blog-heading a { color: var(--ink); text-decoration: none; }
.blog-heading a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .12em; }
.blog-category { margin: 0 0 12px; color: #287739; font-size: .78rem; font-weight: 750; letter-spacing: .055em; line-height: 1.5; text-transform: uppercase; overflow-wrap: anywhere; }
.blog-featured { padding: 34px 0 38px; }
.blog-featured--illustrated { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.blog-featured-copy { min-width: 0; }
.blog-featured .blog-heading { max-width: 960px; font-size: clamp(1.9rem, 3vw, 2.8rem); }
.blog-lead { margin: 20px 0; color: #383838; font-size: clamp(1.05rem, 1.5vw, 1.2rem); line-height: 1.65; overflow-wrap: anywhere; }
.blog-meta { margin: 20px 0 0; color: var(--ink-muted); font-size: .88rem; line-height: 1.65; }
.blog-author { display: block; margin-top: 4px; }
.blog-illustration { display: block; width: 100%; max-width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.blog-latest { border-top: 1px solid var(--line); padding-top: 26px; }
.blog-latest > .blog-heading { margin-bottom: 8px; font-size: 1.8rem; }
.blog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 64px; }
.blog-entry { min-width: 0; padding: 28px 0; border-bottom: 1px solid var(--line); }
.blog-entry:nth-child(even) { border-left: 1px solid var(--line); padding-left: 32px; margin-left: -32px; }
.blog-entry .blog-heading { font-size: clamp(1.5rem, 2.2vw, 2rem); }
.blog-entry > p:not(.blog-category):not(.blog-meta) { margin: 12px 0; color: #414140; overflow-wrap: anywhere; }
.blog-entry .blog-meta { margin-top: 12px; }
.blog-empty { min-height: 220px; padding: 44px 0 70px; color: var(--ink-muted); font-size: 1.12rem; }
.blog-footer { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--ink-muted); font-size: .9rem; line-height: 1.7; }
.blog-footer .investment-notice { margin-top: 0; }
.blog-back { display: inline-block; color: var(--ink-muted); text-underline-offset: 4px; }
.blog-story { width: 100%; max-width: 740px; min-width: 0; margin-inline: auto; }
.article-header, .article-body { min-width: 0; max-width: 100%; }
.blog-story > .blog-back { margin-bottom: 32px; }
.article-header .blog-heading { font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.1; }
.article-header .blog-meta { margin-bottom: 28px; }
.article-body { margin-top: 36px; color: #30302f; font-size: 1.08rem; line-height: 1.85; overflow-wrap: anywhere; }
.article-body h2, .article-body h3, .article-body h4, .article-body h5, .article-body h6 { font-family: var(--editorial); color: var(--ink); line-height: 1.25; margin: 1.6em 0 .65em; }
.article-body h2 { font-size: 1.8rem; }
.article-body h3 { font-size: 1.4rem; }
.article-body a { color: #287739; text-underline-offset: 3px; }
.article-body blockquote { margin: 28px 0; padding: 2px 0 2px 24px; border-left: 2px solid #287739; color: var(--ink-muted); }
.article-body pre { max-width: 100%; overflow-x: auto; padding: 16px; border: 1px solid var(--line); font-size: .85rem; line-height: 1.6; }
.article-body img { display: block; max-width: 100%; height: auto; margin: 28px 0; }
/* Markdown table standard: docs/BLOG_TABLES.md. No visitor-side JavaScript. */
.article-body .blog-table-wrap { max-width: 100%; min-width: 0; margin: 24px 0; }
.article-body .blog-table { width: 100%; border-collapse: collapse; font-size: 1rem; line-height: 1.55; font-variant-numeric: tabular-nums; }
.article-body .blog-table--cards { table-layout: fixed; }
.article-body .blog-table th, .article-body .blog-table td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.article-body .blog-table thead th { font-weight: 650; }
.article-body .blog-table tbody th { font-weight: 600; }
.article-body .blog-table__label[hidden] { display: none; }
.article-body .blog-table-wrap--scroll { overflow-x: auto; overscroll-behavior-x: contain; }
.article-body .blog-table-wrap--scroll .blog-table { min-width: 640px; }
.article-body .blog-table-hint { margin: 0 0 10px; color: var(--ink-muted); font-size: .85rem; line-height: 1.5; }
.article-body .blog-table-wrap--scroll:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
@media (max-width: 768px) {
  .article-body .blog-table--cards, .article-body .blog-table--cards tbody { display: block; width: 100%; }
  /* Keep column headers in the accessibility tree and their IDs as cell references. */
  .article-body .blog-table--cards thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .article-body .blog-table--cards tbody tr { display: block; padding: 18px 0; border-top: 1px solid var(--line); }
  .article-body .blog-table--cards tbody tr:last-child { border-bottom: 1px solid var(--line); }
  .article-body .blog-table--cards tbody th { display: block; padding: 0 0 10px; border: 0; font-size: 1.05rem; text-align: left !important; }
  .article-body .blog-table--cards td { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 16px; padding: 6px 0; border: 0; text-align: left !important; }
  .article-body .blog-table--cards .blog-table__label[hidden] { display: block; color: var(--ink-muted); }
  .article-body .blog-table__value { min-width: 0; }
  .article-body .blog-table__numeric .blog-table__value { text-align: right; }
}
@media (max-width: 375px) {
  .article-body .blog-table--cards td { grid-template-columns: minmax(0, 1fr); gap: 3px; padding: 8px 0; }
  .article-body .blog-table__numeric .blog-table__value { text-align: left; }
}
@media (max-width: 899px) {
  .blog-featured--illustrated { gap: 28px; }
  .blog-grid { column-gap: 40px; }
  .blog-entry:nth-child(even) { padding-left: 20px; margin-left: -20px; }
}
@media (max-width: 760px) {
  .blog-featured--illustrated, .blog-grid { display: flex; flex-direction: column; }
  .blog-featured--illustrated .blog-illustration { order: -1; }
  .blog-featured { padding-top: 26px; }
  .blog-entry:nth-child(even) { border-left: 0; padding-left: 0; margin-left: 0; }
  .blog-entry { width: 100%; }
  .blog-category { font-size: .74rem; }
  .blog-empty { min-height: 180px; padding-top: 32px; }
  .blog-story > .blog-back { margin-bottom: 24px; }
}
