/* ASIC media order: BASE > max-width DESC (cascade) > min-width ASC > other.
 Scale: phone<=575 | tablet<=991 | laptop 992-1199 | laptopLarge 1200-1439 | desktop>=1440 | wide>=1680 | header<=1023/>=1024
 Source: breakpoints.css */

@keyframes asic-shimmer {
	0% {
		background-position: 100% 0;
	}
	100% {
		background-position: -100% 0;
	}
}

/* === BASE === */
.product-profit {
	--pp-border: #e8e8e8;
	--pp-muted: #8a8a8a;
	--pp-text: #1a1a1a;
	--pp-green: #2d8c66;
	--pp-red: #d36a5c;
	--pp-accent: #f07a2a;
	--pp-soft: #f7f4ef;
	--pp-skel: #eceef2;
	--pp-skel-hi: #f8f9fb;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
}

.product-profit__inner {
	padding: 10px 24px;
	background: #fff;
	border: 1px solid var(--pp-border);
	border-radius: 14px;
	box-sizing: border-box;
}

.product-profit__inner--split {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.95fr);
	gap: 28px 32px;
	align-items: start;
}

.product-profit__main,
.product-profit__history {
	min-width: 0;
}

.product-profit__history {
	padding-left: 28px;
	border-left: 1px solid #eee;
}

.product-profit__title--hist {
	font-size: 20px;
}

.product-profit__hist-stats {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	margin: 0 0 16px;
}

.product-profit__hist-stat {
	padding: 12px 14px;
	background: #fff;
	border: 1px solid var(--pp-border);
	border-radius: 10px;
	min-width: 0;
}

.product-profit__hist-stat-label {
	display: block;
	margin: 0 0 8px;
	color: var(--pp-muted);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.02em;
	line-height: 1.3;
	text-transform: uppercase;
	overflow-wrap: anywhere;
}

.product-profit__hist-stat-value {
	display: block;
	color: var(--pp-text);
	font-size: 20px;
	font-weight: 700;
	line-height: 1.2;
	white-space: nowrap;
}

.product-profit__hist-stat-value.is-positive {
	color: var(--pp-green);
}

.product-profit__hist-stat-value.is-negative {
	color: var(--pp-red);
}

.product-profit__hist-stat-value--skel .product-profit__skel {
	width: 76px;
	height: 20px;
	border-radius: 8px;
}

.product-profit__chart {
	margin: 0 0 14px;
}

.product-profit__chart-plot {
	position: relative;
}

.product-profit__chart-svg {
	display: block;
	width: 100%;
	height: 180px;
	cursor: crosshair;
}

.product-profit__chart-tip {
	position: absolute;
	top: 8px;
	z-index: 2;
	min-width: 148px;
	padding: 8px 10px;
	background: #fff;
	border: 1px solid var(--pp-border);
	border-radius: 8px;
	box-shadow: 0 8px 22px rgba(0, 0, 0, 0.1);
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
}

.product-profit__chart-tip.is-on {
	opacity: 1;
	visibility: visible;
}

.product-profit__chart-tip-date {
	margin: 0 0 6px;
	color: var(--pp-text);
	font-size: 12px;
	font-weight: 700;
	line-height: 1.2;
}

.product-profit__chart-tip-row {
	display: flex;
	align-items: center;
	gap: 6px;
	color: #555;
	font-size: 12px;
	line-height: 1.35;
}

.product-profit__chart-tip-row + .product-profit__chart-tip-row {
	margin-top: 3px;
}

.product-profit__chart-tip-label {
	flex: 1 1 auto;
	min-width: 0;
}

.product-profit__chart-tip-row strong {
	margin-left: auto;
	color: var(--pp-text);
	font-weight: 700;
	white-space: nowrap;
}

.product-profit__chart-tip-row.is-revenue .product-profit__chart-dot {
	background: var(--pp-green);
}

.product-profit__chart-tip-row.is-net .product-profit__chart-dot {
	background: var(--pp-accent);
}

.product-profit__chart-tip-row.is-price .product-profit__chart-dot {
	background: #3b82f6;
}

.product-profit__chart-tip-row.is-difficulty .product-profit__chart-dot {
	background: #8b5cf6;
}

.product-profit__chart-tip-row.is-nethash .product-profit__chart-dot {
	background: #0d9488;
}

.product-profit__chart-skel {
	display: block;
	width: 100%;
	height: 180px;
	margin: 0 0 8px;
}

.product-profit__skel--chart {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 10px;
}

.product-profit__chart-axis {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	margin: 4px 0 10px;
	color: var(--pp-muted);
	font-size: 11px;
	line-height: 1.2;
}

.product-profit__chart-axis span {
	flex: 1 1 0;
	min-width: 0;
	text-align: center;
}

.product-profit__chart-axis span:first-child {
	text-align: left;
}

.product-profit__chart-axis span:last-child {
	text-align: right;
}

.product-profit__chart-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 16px;
	margin: 0 0 4px;
}

.product-profit__chart-legend-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: #555;
	font-size: 13px;
	line-height: 1.2;
	cursor: pointer;
	user-select: none;
}

.product-profit__chart-legend-item input {
	width: 14px;
	height: 14px;
	margin: 0;
	flex: 0 0 auto;
	accent-color: var(--pp-green);
	cursor: pointer;
}

.product-profit__chart-legend-item:not(:has(input:checked)) {
	opacity: 0.42;
}

.product-profit__chart-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--pp-green);
}

.product-profit__chart-legend-item.is-net .product-profit__chart-dot,
.product-profit__chart-legend-item.is-net input {
	accent-color: var(--pp-accent);
}

.product-profit__chart-legend-item.is-net .product-profit__chart-dot {
	background: var(--pp-accent);
}

.product-profit__chart-legend-item.is-price .product-profit__chart-dot,
.product-profit__chart-legend-item.is-price input {
	accent-color: #3b82f6;
}

.product-profit__chart-legend-item.is-price .product-profit__chart-dot {
	background: #3b82f6;
}

.product-profit__chart-legend-item.is-difficulty .product-profit__chart-dot,
.product-profit__chart-legend-item.is-difficulty input {
	accent-color: #8b5cf6;
}

.product-profit__chart-legend-item.is-difficulty .product-profit__chart-dot {
	background: #8b5cf6;
}

.product-profit__chart-legend-item.is-nethash .product-profit__chart-dot,
.product-profit__chart-legend-item.is-nethash input {
	accent-color: #0d9488;
}

.product-profit__chart-legend-item.is-nethash .product-profit__chart-dot {
	background: #0d9488;
}

.product-profit__ranges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 10px;
}

.product-profit__range {
	min-width: 42px;
	height: 32px;
	padding: 0 10px;
	border: 1px solid #e6e6e6;
	border-radius: 8px;
	background: #f7f7f7;
	color: #333;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.product-profit__range:hover {
	border-color: #ffd2b0;
	color: #ff6a16;
}

.product-profit__range.is-active {
	border-color: var(--pp-accent);
	background: var(--pp-accent);
	color: #fff;
}

.product-profit__head {
	margin: 0 0 18px;
}

.product-profit__title {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0 0 8px;
	padding-bottom: 0;
	color: var(--pp-text);
	font-size: 22px;
	font-weight: 700;
	line-height: 1.25;
}

.product-profit__title::after {
	content: none;
	display: none;
}

.product-profit__title::before {
	content: "";
	flex: 0 0 auto;
	width: 8px;
	height: 8px;
	margin-top: 0.42em;
	border-radius: 2px;
	background: var(--pp-accent);
}

.product-profit__subtitle {
	margin: 0;
	color: var(--pp-muted);
	font-size: 14px;
	line-height: 1.45;
	font-weight: 400;
}

.product-profit__controls {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px 16px;
	margin: 0 0 16px;
}

.product-profit__ee {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

.product-profit__ee-label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	color: var(--pp-text);
	font-size: 13px;
	font-weight: 500;
	line-height: 1.3;
}

.product-profit__ee-icon {
	display: inline-flex;
	color: var(--pp-accent);
	line-height: 0;
}

.product-profit__ee-field {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 40px;
	padding: 0 10px 0 12px;
	background: #fff;
	border: 1px solid var(--pp-border);
	border-radius: 8px;
}

.product-profit__ee-prefix,
.product-profit__ee-unit {
	color: var(--pp-muted);
	font-size: 14px;
	line-height: 1;
	white-space: nowrap;
}

.product-profit__ee-input {
	width: 72px;
	margin: 0;
	padding: 8px 0;
	border: 0;
	background: transparent;
	color: var(--pp-text);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	appearance: textfield;
	-moz-appearance: textfield;
}

.product-profit__ee-input::-webkit-outer-spin-button,
.product-profit__ee-input::-webkit-inner-spin-button {
	opacity: 1;
	height: 24px;
}

.product-profit__power {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 6px 14px;
	background: #f3f3f3;
	border-radius: 999px;
	color: #555;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.3;
	white-space: nowrap;
}

.product-profit__power--skel {
	min-width: 180px;
	background: transparent;
	padding: 0;
}

.product-profit__metrics {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0;
	margin: 0 0 18px;
	background: var(--pp-soft);
	border: 1px solid rgba(0, 0, 0, 0.04);
	border-radius: 10px;
	overflow: hidden;
}

.product-profit__inner--split .product-profit__table {
	min-width: 520px;
}

.product-profit__metric {
	padding: 10px 10px 9px;
	border-right: 1px solid rgba(0, 0, 0, 0.06);
	min-width: 0;
}

.product-profit__metric:last-child {
	border-right: 0;
}

.product-profit__metric-label {
	display: block;
	margin: 0 0 4px;
	color: var(--pp-muted);
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.02em;
	line-height: 1.25;
	text-transform: uppercase;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.product-profit__metric-value {
	display: block;
	color: var(--pp-text);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.product-profit__table-wrap {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.product-profit__table {
	width: 100%;
	min-width: 560px;
	border-collapse: collapse;
	table-layout: fixed;
}

.product-profit__table th,
.product-profit__table td {
	padding: 12px 10px;
	border-bottom: 1px solid #ececec;
	text-align: left;
	vertical-align: middle;
	font-size: 14px;
	line-height: 1.35;
}

.product-profit__table thead th {
	padding-top: 10px;
	padding-bottom: 10px;
	background: #f5f5f5;
	color: var(--pp-muted);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

.product-profit__table thead th:first-child {
	border-radius: 8px 0 0 8px;
}

.product-profit__table thead th:last-child {
	border-radius: 0 8px 8px 0;
}

.product-profit__table tbody th {
	color: var(--pp-text);
	font-weight: 600;
}

.product-profit__cell--revenue,
.product-profit__cell--net {
	color: var(--pp-green);
	font-weight: 600;
}

.product-profit__cell--ee {
	color: var(--pp-red);
	font-weight: 500;
}

.product-profit__cell--coin {
	color: #777;
	font-size: 13px;
}

.product-profit__coins {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
}

.product-profit__coin {
	display: inline-flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 1px;
	line-height: 1.2;
}

.product-profit__coin-amount {
	font-weight: 500;
}

.product-profit__coin-symbol {
	font-size: 11px;
	color: #999;
}

.product-profit__skel {
	display: inline-block;
	width: 72px;
	height: 14px;
	border-radius: 6px;
	background-color: var(--pp-skel);
	background-image: linear-gradient(
		90deg,
		var(--pp-skel) 0%,
		var(--pp-skel-hi) 42%,
		var(--pp-skel) 84%
	);
	background-size: 220% 100%;
	animation: asic-shimmer 1.15s ease-in-out infinite;
	vertical-align: middle;
}

.product-profit__metric-value--skel .product-profit__skel {
	width: 88px;
	height: 22px;
	border-radius: 8px;
}

.product-profit__power--skel .product-profit__skel {
	width: 180px;
	height: 28px;
	border-radius: 999px;
}

.product-profit__skel--coin {
	width: 64px;
	height: 28px;
}

.product-profit__table tbody tr:last-child th,
.product-profit__table tbody tr:last-child td {
	border-bottom: 0;
}

/* === TABLET (max: 991px) === */
@media (max-width: 991px) {
	.product-profit__inner {
		padding: 10px 16px;
	}

	.product-profit__inner--split {
		grid-template-columns: 1fr;
		gap: 22px;
	}

	.product-profit__history {
		padding-left: 0;
		padding-top: 18px;
		border-left: 0;
		border-top: 1px solid #eee;
	}

	.product-profit__title {
		font-size: 20px;
	}

	.product-profit__metrics {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.product-profit__metric:nth-child(2) {
		border-right: 0;
	}

	.product-profit__metric:nth-child(1),
	.product-profit__metric:nth-child(2) {
		border-bottom: 1px solid rgba(0, 0, 0, 0.06);
	}

	.product-profit__metric-value {
		font-size: 20px;
	}

	.product-profit__chart-svg,
	.product-profit__chart-skel {
		height: 160px;
	}
}

/* === PHONE (max: 575px) === */
@media (max-width: 575px) {
	.product-profit__controls {
		flex-direction: column;
		align-items: stretch;
	}

	.product-profit__power {
		align-self: flex-start;
		white-space: normal;
	}

	.product-profit__metric {
		padding: 12px;
	}

	.product-profit__metric-value {
		font-size: 18px;
	}

	.product-profit__hist-stat {
		padding: 10px 12px;
	}

	.product-profit__hist-stat-value {
		font-size: 17px;
	}

	.product-profit__range {
		min-width: 38px;
		height: 30px;
		padding: 0 8px;
		font-size: 11px;
	}
}
