/**
 * InveShares frontend styles.
 *
 * Loaded only on pages that actually contain an InveShares shortcode, so no
 * other page on the site pays for it.
 *
 * Deliberately restrained: it inherits the theme's fonts and colours rather
 * than imposing a look, so it sits inside whatever theme the site is running
 * instead of fighting it.
 *
 * @package InveShares
 */

.inveshares-fe {
	--ivs-fe-line: rgba(128, 128, 128, .25);
	--ivs-fe-muted: rgba(128, 128, 128, 1);
	--ivs-fe-up: #1a7f37;
	--ivs-fe-down: #b32d2e;
	--ivs-fe-accent: #2271b1;
	--ivs-fe-radius: 6px;

	font-size: 1rem;
	line-height: 1.6;
}

.inveshares-fe-header h2 {
	margin-bottom: .2em;
}

.inveshares-fe-sub,
.inveshares-fe-note {
	color: var(--ivs-fe-muted);
	font-size: .9em;
}

/* ----------------------------------------------------------------- tiles */

.inveshares-fe-tiles {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	margin: 1.5em 0;
}

.inveshares-fe-tile {
	border: 1px solid var(--ivs-fe-line);
	border-radius: var(--ivs-fe-radius);
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 14px 16px;
}

.inveshares-fe-tile-label {
	color: var(--ivs-fe-muted);
	font-size: .75em;
	letter-spacing: .05em;
	text-transform: uppercase;
}

.inveshares-fe-tile-value {
	font-size: 1.6em;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	line-height: 1.2;
}

.inveshares-fe-tile-note {
	color: var(--ivs-fe-muted);
	font-size: .8em;
}

/* ---------------------------------------------------------------- tables */

/* Wraps the table so a wide grid scrolls inside its own box rather than
   pushing the whole page sideways on a phone. */
.inveshares-fe-scroll {
	-webkit-overflow-scrolling: touch;
	margin: 1em 0;
	overflow-x: auto;
}

.inveshares-fe-table {
	border-collapse: collapse;
	width: 100%;
}

.inveshares-fe-table th,
.inveshares-fe-table td {
	border-bottom: 1px solid var(--ivs-fe-line);
	padding: 10px 12px;
	text-align: left;
}

.inveshares-fe-table th {
	color: var(--ivs-fe-muted);
	font-size: .78em;
	letter-spacing: .04em;
	text-transform: uppercase;
	white-space: nowrap;
}

.inveshares-fe-num {
	font-variant-numeric: tabular-nums;
	text-align: right;
	white-space: nowrap;
}

.inveshares-fe-positive {
	color: var(--ivs-fe-up);
}

.inveshares-fe-negative {
	color: var(--ivs-fe-down);
}

.inveshares-fe-rs {
	background: var(--ivs-fe-accent);
	border-radius: 4px;
	color: #fff;
	display: inline-block;
	font-size: .85em;
	font-weight: 600;
	min-width: 2.4em;
	padding: 2px 6px;
	text-align: center;
}

.inveshares-fe-unrated {
	color: var(--ivs-fe-muted);
	font-size: .8em;
	font-style: italic;
}

/* -------------------------------------------------------- empty states */

.inveshares-fe-empty,
.inveshares-fe-pending {
	border: 1px dashed var(--ivs-fe-line);
	border-radius: var(--ivs-fe-radius);
	margin: 1em 0;
	padding: 18px 20px;
}

.inveshares-fe-pending {
	border-style: solid;
	border-left-width: 3px;
	border-left-color: var(--ivs-fe-accent);
}

.inveshares-fe-empty p:last-child,
.inveshares-fe-pending p:last-child {
	margin-bottom: 0;
}

.inveshares-fe-disclaimer {
	border-top: 1px solid var(--ivs-fe-line);
	color: var(--ivs-fe-muted);
	font-size: .82em;
	margin-top: 2em;
	padding-top: 1em;
}

/* ------------------------------------------------------- filters, pages */

.inveshares-fe-filters {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 1em 0;
}

.inveshares-fe-filters label {
	color: var(--ivs-fe-muted);
	font-size: .85em;
}

.inveshares-fe-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 1em 0;
}

.inveshares-fe-page {
	border: 1px solid var(--ivs-fe-line);
	border-radius: 4px;
	display: inline-block;
	min-width: 2.2em;
	padding: 4px 8px;
	text-align: center;
	text-decoration: none;
}

.inveshares-fe-page.current {
	background: var(--ivs-fe-accent);
	border-color: var(--ivs-fe-accent);
	color: #fff;
}

/* ------------------------------------------------------------ a11y */

.inveshares-fe :focus-visible {
	outline: 2px solid var(--ivs-fe-accent);
	outline-offset: 2px;
}

@media screen and (max-width: 600px) {
	.inveshares-fe-tiles {
		grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
	}

	.inveshares-fe-table th,
	.inveshares-fe-table td {
		padding: 8px;
	}

	.inveshares-fe-filters input {
		flex: 1 1 100%;
	}
}

/* 1.23 research controls: collapsed by default, quiet when closed. */
.inveshares-filter-disclosure {
  margin: 0 0 1.25rem;
  border: 1px solid var(--ivs-border, rgba(127,127,127,.22));
  border-radius: 18px;
  background: var(--ivs-surface, transparent);
  overflow: hidden;
}
.inveshares-filter-disclosure > summary {
  cursor: pointer;
  list-style: none;
  padding: .95rem 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.inveshares-filter-disclosure > summary::-webkit-details-marker { display:none; }
.inveshares-filter-disclosure > summary::after { content:'+'; font-size:1.2rem; opacity:.7; }
.inveshares-filter-disclosure[open] > summary::after { content:'−'; }
.inveshares-filter-disclosure > form { margin: 0; border-top: 1px solid var(--ivs-border, rgba(127,127,127,.16)); }
.inveshares-rs-explainer {
  margin: .6rem 0 1.4rem;
  color: var(--ivs-muted, #777);
  font-size: .88rem;
  line-height: 1.55;
}
.inveshares-rs-explainer strong { color: var(--ivs-text, currentColor); }


/* 2.6 pattern-first VCP and backtest presentation. */
.inveshares-screen-chart-card--pattern { overflow: hidden; }
.inveshares-screen-chart-card--pattern .inveshares-screen-chart-meta { display:flex; flex-wrap:wrap; gap:.45rem .9rem; padding:.7rem .85rem 0; font-size:.86rem; color:var(--ivs-fe-muted); }
.inveshares-screen-chart-card--pattern .inveshares-screen-chart-meta span { white-space:nowrap; }
.inveshares-screen-chart-why { margin:.7rem .85rem; padding:.7rem .8rem; border:1px solid var(--ivs-fe-line); border-radius:12px; color:var(--ivs-fe-muted); }
.inveshares-screen-chart-why strong { color:var(--ivs-fe-text); margin-right:.4rem; }
.inveshares-screen-chart-actions { padding:.4rem .85rem .85rem; }
.inveshares-backtest-tabs { display:grid; grid-template-columns:repeat(3,1fr); border-bottom:1px solid var(--ivs-fe-line); margin:0 0 1rem; }
.inveshares-backtest-tabs a { padding:.8rem .5rem; text-align:center; color:var(--ivs-fe-muted); text-decoration:none; font-weight:700; border-bottom:3px solid transparent; }
.inveshares-backtest-tabs a.is-active { color:var(--ivs-fe-text); border-bottom-color:var(--ivs-fe-accent); }
.inveshares-backtest-settings-card,.inveshares-backtest-result-card,.inveshares-backtest-empty,.inveshares-public-trades { border:1px solid var(--ivs-fe-line); border-radius:18px; padding:1rem; margin:1rem 0; background:var(--ivs-fe-surface); }
.inveshares-public-backtest-form label { display:flex; flex-direction:column; gap:.35rem; margin-bottom:.8rem; color:var(--ivs-fe-muted); font-weight:700; }
.inveshares-public-backtest-form input,.inveshares-public-backtest-form select { width:100%; box-sizing:border-box; }
.inveshares-backtest-option-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.7rem; }
.inveshares-backtest-hero { display:flex; align-items:flex-end; gap:.7rem; padding:.7rem 0 1rem; font-size:1rem; color:var(--ivs-fe-muted); }
.inveshares-backtest-hero strong { font-size:2rem; color:var(--ivs-fe-text); }
.inveshares-backtest-metrics { display:grid; grid-template-columns:repeat(4,1fr); gap:.5rem; }
.inveshares-backtest-metrics div { padding:.75rem; border-top:1px solid var(--ivs-fe-line); }
.inveshares-backtest-metrics b { display:block; font-size:.72rem; text-transform:uppercase; letter-spacing:.08em; color:var(--ivs-fe-muted); margin-bottom:.25rem; }
.inveshares-public-trades h3 span { color:var(--ivs-fe-muted); font-weight:400; }
@media screen and (max-width:600px){ .inveshares-backtest-option-grid,.inveshares-backtest-metrics{grid-template-columns:repeat(2,minmax(0,1fr));}.inveshares-screen-chart-card--pattern .inveshares-chart{margin-top:.2rem;} }

.inveshares-chart-base-duration{font-size:22px;font-weight:700;fill:currentColor;opacity:.72}.inveshares-chart-base-label{font-weight:700}
