/* Shared presentation for the public EvidentChain pages. */
body[data-ec-ui] {
  --pq-ink: #222d28;
  --pq-nav: #202b24;
  --pq-paper: #faf9f5;
  --pq-panel: #fffef9;
  --pq-line: #ddd9ce;
  --pq-lilac: #eee9f7;
  --pq-violet: #624d7b;
  --pq-nav-text: #f7f8f0;
  --pq-nav-action: #e1eadf;
  --pq-wide: min(1260px, calc(100% - 40px));
  --pq-content: min(1180px, calc(100% - 72px));
  --pq-mono: Consolas, "Liberation Mono", monospace;
  --ec-paper: var(--pq-paper);
  --ec-white: var(--pq-panel);
  --ec-line: var(--pq-line);
}

body[data-ec-ui] :is(.fin-wrap, .j-wrap) { width: var(--pq-content); }
body[data-ec-ui] :is(.fin-header:not(.fin-market-header), .j-header) {
  margin-block: 18px 0;
  border: 0;
  background: transparent;
}
body[data-ec-ui] :is(.fin-header:not(.fin-market-header) .fin-head-row, .j-header .j-nav,
                     #app > .header .header-inner, .account-top) {
  width: var(--pq-wide);
  min-height: 64px;
  height: auto;
  margin-inline: auto;
  padding: 8px clamp(16px, 2.2vw, 28px);
  border: 0;
  border-radius: 38px;
  color: var(--pq-nav-text);
  background: var(--pq-nav);
}
body[data-ec-ui] :is(.fin-header:not(.fin-market-header), .j-header) :is(.fin-brand, .j-brand) {
  gap: 8px;
  color: var(--pq-nav-text);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 700;
  letter-spacing: -.05em;
}
body[data-ec-ui] :is(.fin-header:not(.fin-market-header), .j-header) :is(.fin-logo, .j-brand > svg) { color: #deeadc; background: transparent; }
@supports (mask-image: url("mark.svg")) {
  body[data-ec-ui] :is(.fin-header:not(.fin-market-header) .fin-brand, .j-header .j-brand, .account-top .brand)::before,
  body:is([data-ec-ui="participate"], [data-ec-ui="exchange"]) > header .brand::before {
    content: "";
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    background: #deeadc;
    mask: url("mark.svg") center / contain no-repeat;
  }
  body[data-ec-ui] :is(.fin-header:not(.fin-market-header) .fin-logo, .j-header .j-brand > svg, .account-top .brand .mark) { display: none; }
}
body[data-ec-ui] .j-header .j-brand small { display: none; }
body[data-ec-ui] :is(.fin-header:not(.fin-market-header) .fin-nav, .j-header .j-desktop) { margin-inline: auto 0; }
body[data-ec-ui] .fin-header:not(.fin-market-header) .fin-nav a,
body[data-ec-ui] .j-header .j-desktop a { color: #e5e9df; }
body[data-ec-ui] .fin-header:not(.fin-market-header) .fin-nav a:is(:hover, [aria-current]),
body[data-ec-ui] .j-header .j-desktop a:is(:hover, [aria-current]) { color: #fff; border-bottom-color: #e1eadf; }
body[data-ec-ui] .j-header .j-desktop a[aria-current]::after { background: #e1eadf; bottom: -5px; }
body[data-ec-ui] .j-header .j-desktop small { color: #d0dccd; }
body[data-ec-ui] :is(.fin-header:not(.fin-market-header) .fin-head-actions > .fin-button, .j-header .j-nav-cta,
                     #app > .header .header-button, .account-top .right .button) {
  border-color: transparent;
  border-radius: 30px;
  background: var(--pq-nav-action);
  color: #25362c !important;
}
body[data-ec-ui] :is(.fin-header:not(.fin-market-header) .fin-head-actions > .fin-button, .j-header .j-nav-cta,
                     #app > .header .header-button, .account-top .right .button):hover { background: #f1f5ec; }
body[data-ec-ui] :is(.fin-header:not(.fin-market-header) .fin-language, .j-header .j-search-link,
                     #app > .header :is(.header-nav a, .lang-button), .account-top .right .lang) { color: #f1f3eb; }
body[data-ec-ui] :is(.fin-header:not(.fin-market-header) .fin-language:hover, #app > .header .lang-button:hover) { background: #ffffff20; color: #fff; }
body[data-ec-ui] :is(.fin-header:not(.fin-market-header) .fin-mobile summary, .j-header .j-mobile-nav summary) { color: #fff; background: transparent; border-color: #ffffff42; }
body[data-ec-ui] :is(.fin-header:not(.fin-market-header) .fin-mobile nav, .j-header .j-mobile-nav nav) { background: var(--pq-panel); color: var(--pq-ink); }
body[data-ec-ui] :is(.fin-header, .j-header, .account-top) :is(.fin-brand, .j-brand, .brand, .fin-nav a, .j-desktop a, summary):focus-visible,
body:is([data-ec-ui="participate"], [data-ec-ui="exchange"]) > header :focus-visible { outline-color: #e1eadf; }
body[data-ec-ui] .j-page .j-top,
body[data-ec-ui].j-page .j-top { background: var(--pq-paper); color: var(--pq-ink); border-color: var(--pq-line); }

/* Give reading and discovery pages the network page's hierarchy. */
[data-ec-ui="home"] .fin-hero { padding-block: clamp(38px, 6vw, 78px) clamp(30px, 5vw, 64px); }
[data-ec-ui="home"] .fin-hero-grid { grid-template-columns: minmax(0, 1.2fr) minmax(290px, .85fr); }
[data-ec-ui="home"].fin-shell .fin-hero h1,
[data-ec-ui="journal"] .fin-editorial-hero h1,
[data-ec-ui="tools"] :is(.fin-editorial-hero h1, .home-hero h1),
[data-ec-ui="participate"] .hero h1,
[data-ec-ui="exchange"] .hero h1 {
  color: var(--pq-ink);
  font: 500 clamp(34px, 5vw, 68px)/1.16 var(--ec-sans);
  letter-spacing: -.055em;
  text-wrap: balance;
}
[data-ec-ui="home"] .fin-hero p,
[data-ec-ui] :is(.fin-editorial-hero p, .j-article-head > p),
[data-ec-ui="tools"] .hero-description { color: #665b71; }
body[data-ec-ui]:not([data-ec-ui="market"]) :is(.fin-kicker, .j-kicker, .home-hero .eyebrow, .hero .eyebrow) {
  color: var(--pq-violet);
  font-family: var(--pq-mono);
  font-weight: 500;
  letter-spacing: .085em;
}
body[data-ec-ui]:not([data-ec-ui="market"]) :is(.fin-hero .fin-kicker, .fin-editorial-hero .fin-kicker, .j-article-head .j-kicker, .home-hero .eyebrow, .hero .eyebrow)::before {
  content: "";
  display: inline-block;
  width: 23px;
  height: 1px;
  margin: 0 10px 3px 0;
  background: #a79ab7;
}
[data-ec-ui] .fin-editorial-hero { padding-block: clamp(34px, 5.3vw, 69px) clamp(28px, 4vw, 47px); }
[data-ec-ui] .fin-editorial-hero h1 { margin-block: 13px 12px; }
[data-ec-ui] :is(.fin-heading h2, .j-section-title h2, .j-article-head h1) { font-weight: 530; letter-spacing: -.04em; }
[data-ec-ui] .j-article-head h1 { font-size: clamp(29px, 4.5vw, 56px); line-height: 1.25; }
[data-ec-ui="home"] .fin-board { border: 1px solid var(--pq-line); padding: clamp(16px, 2.25vw, 24px); }
[data-ec-ui="home"] .fin-board .fin-badge { background: var(--pq-lilac); color: var(--pq-violet); border-radius: 30px; }
[data-ec-ui="home"] .fin-home-news .ec-news-latest { border-top-width: 1px; }
body[data-ec-ui] :is(.j-page, .j-library, .j-filter-list) :is(.j-filters button, .j-search-scope button) { border-radius: 30px; }
[data-ec-ui].j-page .j-filters button[aria-pressed="true"] { background: var(--pq-nav); }
[data-ec-ui] :is(.fin-footer, .j-footer, .m-footer) { background: #21211f; border-color: #21211f; color: #f4f1e8; }
[data-ec-ui] :is(.fin-footer, .j-footer, .m-footer) :is(p, small, a) { color: #e1ded2; }

/* PlainKit renders this header dynamically on each tool route. */
[data-ec-ui="tools"] #app > .header { height: auto; margin-top: 13px; border: 0; background: transparent; }
[data-ec-ui="tools"] #app > .header .brand { color: var(--pq-nav-text); }
[data-ec-ui="tools"] #app > .header .brand-mark { background: #e1eadf; border-color: #e1eadf; }
[data-ec-ui="tools"] #app > .header .brand-name small { color: #d4e0d2; }
[data-ec-ui="tools"] #app > .header .search-trigger { background: #f4f6f0; border-color: #e1eadf; color: #34483c; }
[data-ec-ui="tools"] :is(.tool-icon, .tool-heading .pill) { background: var(--pq-lilac); color: var(--pq-violet); }
[data-ec-ui="tools"] :is(.tool-card, .editor, .editor-panel, .tool-panel, .workspace-panel, .result-status) { border-color: var(--pq-line); }
[data-ec-ui="tools"] :is(.tool-heading h1, .article h1) { font-weight: 560; letter-spacing: -.045em; }
[data-ec-ui="tools"] .home-hero .hero-art { background: #edf0e9; }
[data-ec-ui="tools"] .home-hero .floating-code { transform: none; box-shadow: none; }
[data-ec-ui="tools"] .home-hero .art-result { box-shadow: none; }

/* The transaction pages keep their native form, notices and controls. */
body:is([data-ec-ui="participate"], [data-ec-ui="exchange"]) > header {
  width: var(--pq-wide);
  min-height: 62px;
  margin: 12px auto 0;
  padding: 8px clamp(14px, 2.3vw, 28px);
  border: 0;
  border-radius: 36px;
  background: var(--pq-nav);
  color: var(--pq-nav-text);
}
body:is([data-ec-ui="participate"], [data-ec-ui="exchange"]) > header :is(a, button, .brand span) { color: #f0f4ec; }
body:is([data-ec-ui="participate"], [data-ec-ui="exchange"]) > header .brand { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
body:is([data-ec-ui="participate"], [data-ec-ui="exchange"]) > header .brand span { font-size: .58em; }
body:is([data-ec-ui="participate"], [data-ec-ui="exchange"]) > header #language { border-color: #ffffff40; background: transparent; }
body:is([data-ec-ui="participate"], [data-ec-ui="exchange"]) :is(.strip, .lab-strip) { background: var(--pq-lilac); color: #514264; }
[data-ec-ui="participate"] .hero { padding-block: clamp(35px, 5.5vw, 70px) clamp(21px, 4vw, 36px); }
[data-ec-ui="participate"] :is(.wallet-panel, .panel, .participation-flow a) { background: var(--pq-panel); border-color: var(--pq-line); }
[data-ec-ui="participate"] .participation-flow b:first-child { background: var(--pq-nav); color: #fff; }
[data-ec-ui="participate"] .scope { border-color: #e4d5bb; }
[data-ec-ui="participate"] :is(.hero p, .wallet-panel p) { color: #5a6056; }
[data-ec-ui="participate"] .panel h2 { font-weight: 560; letter-spacing: -.04em; }
[data-ec-ui="participate"] #live-terms .check-label { background: #edf2e9; border-color: #7b967e; }
[data-ec-ui="participate"] :is(#checkout-purchase-form, #checkout-lock-form) { scroll-margin-top: 16px; }

@media (max-width: 930px) {
  body[data-ec-ui] { --pq-content: calc(100% - 36px); }
  body[data-ec-ui] .fin-header:not(.fin-market-header) .fin-head-row { justify-content: space-between; }
  [data-ec-ui="home"] .fin-hero-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  body[data-ec-ui] { --pq-wide: calc(100% - 28px); --pq-content: calc(100% - 28px); }
  body[data-ec-ui] :is(.fin-header:not(.fin-market-header), .j-header) { margin-top: 10px; }
  body[data-ec-ui] :is(.fin-header:not(.fin-market-header) .fin-head-row, .j-header .j-nav, #app > .header .header-inner, .account-top) { min-height: 53px; padding-inline: 13px; gap: 8px; }
  body[data-ec-ui] :is(.fin-header:not(.fin-market-header) .fin-brand, .j-header .j-brand, .account-top .brand)::before,
  body:is([data-ec-ui="participate"], [data-ec-ui="exchange"]) > header .brand::before { width: 23px; height: 23px; flex-basis: 23px; }
  body[data-ec-ui] .j-header .j-search-link { min-width: 33px; }
  [data-ec-ui="home"] .fin-board { padding: 14px; }
  [data-ec-ui="tools"] #app > .header .brand { font-size: 18px; gap: 7px; }
  [data-ec-ui="tools"] #app > .header .brand-name small { font-size: 8px; }
  body:is([data-ec-ui="participate"], [data-ec-ui="exchange"]) > header { min-height: 53px; gap: 7px; }
  body:is([data-ec-ui="participate"], [data-ec-ui="exchange"]) > header .brand { font-size: 18px; }
}
