.loyalty-detail-wrap {
	min-width: 0;
}
.loyalty-detail {
	border: 1px solid var(--border);
	border-radius: 16px;
	background: var(--bg-1);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.gd-head {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 20px;
	padding: 24px 28px 22px;
	border-bottom: 1px solid var(--border);
}
.gd-avatar {
	position: relative;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	font-size: 22px;
	font-weight: 600;
	letter-spacing: -0.02em;
	flex-shrink: 0;
}
.gd-avatar.seg-gold {
	background: linear-gradient(135deg, oklch(0.72 0.16 70), oklch(0.5 0.14 60));
	color: #fff;
}
.gd-avatar.seg-silver {
	background: linear-gradient(135deg, oklch(0.55 0.12 200), oklch(0.4 0.1 200));
	color: #fff;
}
.gd-avatar.seg-new {
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	color: var(--accent-ink);
}
.gd-avatar.seg-sleeping {
	background: var(--bg-2);
	color: var(--fg-mute);
	border: 1px solid var(--border-2);
}
.gd-online {
	position: absolute;
	bottom: 4px;
	right: 4px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: oklch(0.55 0.16 145);
	border: 2px solid var(--bg-1);
}
.gd-head-info {
	min-width: 0;
}
.gd-name {
	font-size: 28px;
	font-weight: 500;
	letter-spacing: -0.02em;
	line-height: 1.1;
}
.gd-tags {
	display: flex;
	gap: 6px;
	align-items: center;
	margin-top: 8px;
	flex-wrap: wrap;
}
.gd-segment {
	padding: 3px 10px;
	border-radius: 100px;
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.02em;
}
.gd-segment.seg-gold {
	background: oklch(0.92 0.06 70);
	color: oklch(0.45 0.13 60);
}
.gd-segment.seg-silver {
	background: oklch(0.92 0.04 200);
	color: oklch(0.4 0.1 200);
}
.gd-segment.seg-new {
	background: var(--glow-accent-soft);
	color: var(--accent);
}
.gd-segment.seg-sleeping {
	background: var(--bg-2);
	color: var(--fg-mute);
}
[data-theme="dark"] .gd-segment.seg-gold {
	background: rgba(216, 165, 80, 0.18);
	color: oklch(0.82 0.13 80);
}
[data-theme="dark"] .gd-segment.seg-silver {
	background: rgba(120, 180, 200, 0.18);
	color: oklch(0.78 0.1 200);
}
.gd-tag {
	padding: 3px 10px;
	border-radius: 100px;
	font-size: 11px;
	border: 1px solid var(--border);
	background: var(--bg);
	color: var(--fg-dim);
	letter-spacing: 0.02em;
}
.gd-contacts {
	display: flex;
	gap: 16px;
	margin-top: 12px;
	flex-wrap: wrap;
}
.gd-contacts span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12.5px;
	color: var(--fg-dim);
}
.gd-contacts span.dim {
	color: var(--fg-mute);
}
.gd-head-actions {
	display: flex;
	gap: 6px;
}

/* KPI grid */
.gd-kpi-grid {
	display: grid;
	grid-template-columns: 1fr 1fr 1.4fr 1fr;
	border-bottom: 1px solid var(--border);
}
.gd-kpi {
	padding: 18px 26px;
	border-right: 1px solid var(--border);
}
.gd-kpi:last-child {
	border-right: none;
}
.gd-kpi .v {
	font-size: 24px;
	font-weight: 500;
	letter-spacing: -0.02em;
	line-height: 1;
}
.gd-kpi .v.accent {
	color: var(--accent);
}
.gd-kpi .v .cur {
	font-family: "Onest", sans-serif;
	font-size: 13px;
	color: var(--fg-dim);
	margin-left: 2px;
	font-weight: 400;
}
.gd-kpi .l {
	font-size: 10.5px;
	color: var(--fg-mute);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	margin-top: 6px;
}
.gd-kpi.big .v {
	font-size: 32px;
}

/* Section */
.gd-section {
	padding: 20px 26px;
	border-bottom: 1px solid var(--border);
}
.gd-section-h {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 16px;
	font-size: 11px;
	color: var(--fg-mute);
	text-transform: uppercase;
	letter-spacing: 0.12em;
}
.gd-section-h .dim {
	color: var(--fg-mute);
	text-transform: none;
	letter-spacing: 0.02em;
}

/* Trend chart */
.gd-trend {
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	gap: 6px;
	align-items: end;
	height: 140px;
}
.gd-trend-col {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	height: 100%;
}
.gd-trend-v {
	font-size: 10px;
	color: var(--fg-mute);
	height: 12px;
	letter-spacing: 0.02em;
}
.gd-trend-bar-wrap {
	flex: 1;
	width: 100%;
	display: flex;
	align-items: flex-end;
}
.gd-trend-bar {
	width: 100%;
	background: linear-gradient(180deg, var(--accent), rgba(142, 93, 216, 0.35));
	border-radius: 6px 6px 2px 2px;
	min-height: 2px;
	opacity: 0.55;
	transition: opacity 0.15s;
}
.gd-trend-bar.peak {
	opacity: 1;
}
.gd-trend-col:hover .gd-trend-bar {
	opacity: 1;
}
.gd-trend-m {
	font-size: 10.5px;
	color: var(--fg-mute);
	letter-spacing: 0.04em;
}
.gd-trend-m.current {
	color: var(--accent);
	font-weight: 500;
}

/* Card grid */
.gd-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
	padding: 20px 26px;
	border-bottom: 1px solid var(--border);
}
.gd-card {
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--bg);
	padding: 16px 18px;
}
.gd-card-wide {
	grid-column: 1 / -1;
}
.gd-card-h {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 12px;
	font-size: 11px;
	color: var(--fg-mute);
	text-transform: uppercase;
	letter-spacing: 0.12em;
}
.gd-card-h .dim {
	color: var(--fg-mute);
	text-transform: none;
	letter-spacing: 0.02em;
}

/* Fav list */
.gd-fav-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.gd-fav-row {
	display: grid;
	grid-template-columns: 28px 1fr auto;
	align-items: center;
	gap: 12px;
	padding: 4px 0;
}
.gd-fav-row + .gd-fav-row {
	border-top: 1px dashed var(--border);
	padding-top: 10px;
}
.gd-fav-icon {
	width: 28px;
	height: 28px;
	border-radius: 8px;
	background: var(--bg-1);
	color: var(--fg-dim);
	display: grid;
	place-items: center;
}
.gd-fav-l {
	font-size: 11px;
	color: var(--fg-mute);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}
.gd-fav-v {
	font-size: 13px;
	font-weight: 500;
	text-align: right;
}
.gd-fav-v em {
	font-style: italic;
	color: var(--accent);
	font-size: 14px;
	font-weight: 400;
}

/* Comment */
.gd-comment {
	font-size: 14px;
	line-height: 1.55;
	color: var(--fg);
	padding: 8px 0;
}
.gd-comment-empty {
	font-size: 13px;
	color: var(--fg-mute);
	line-height: 1.5;
}
.gd-comment-empty em {
	font-style: italic;
	color: var(--accent);
	font-size: 14px;
}

/* Progress / tiers */
.gd-progress-row {
	padding: 6px 0 4px;
}
.gd-progress-bar {
	position: relative;
	height: 8px;
	background: var(--bg-1);
	border: 1px solid var(--border);
	border-radius: 100px;
	overflow: visible;
	margin: 6px 8px;
}
.gd-progress-fill {
	height: 100%;
	background: linear-gradient(90deg, oklch(0.65 0.14 70), var(--accent));
	border-radius: 100px;
	transition: width 0.4s;
}
.gd-progress-tier {
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--bg);
	border: 2px solid var(--fg-mute);
}
.gd-progress-tier span {
	position: absolute;
	top: 18px;
	left: 50%;
	transform: translateX(-50%);
	font-size: 9.5px;
	color: var(--fg-mute);
	letter-spacing: 0.04em;
}
.gd-tiers {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 8px;
	margin-top: 28px;
}
.gd-tier {
	padding: 6px 8px;
	border-radius: 8px;
	background: var(--bg-1);
	border: 1px solid var(--border);
	font-size: 11px;
	text-align: center;
	color: var(--fg-mute);
	letter-spacing: 0.04em;
}
.gd-tier.reached.seg-silver {
	background: oklch(0.92 0.04 200);
	border-color: oklch(0.55 0.12 200);
	color: oklch(0.4 0.1 200);
}
.gd-tier.reached.seg-gold {
	background: oklch(0.92 0.06 70);
	border-color: oklch(0.55 0.13 60);
	color: oklch(0.45 0.13 60);
}
.gd-tier.reached.seg-platinum {
	background: var(--glow-accent);
	border-color: var(--accent);
	color: var(--accent);
}
[data-theme="dark"] .gd-tier.reached.seg-silver {
	background: rgba(120, 180, 200, 0.18);
	color: oklch(0.78 0.1 200);
}
[data-theme="dark"] .gd-tier.reached.seg-gold {
	background: rgba(216, 165, 80, 0.18);
	color: oklch(0.82 0.13 80);
}

/* Visits list */
.gd-visits {
	display: flex;
	flex-direction: column;
}
.gd-visit-row {
	display: grid;
	grid-template-columns: 50px 1fr 50px 90px;
	gap: 14px;
	align-items: center;
	padding: 10px 0;
	border-bottom: 1px dashed var(--border);
}
.gd-visit-row:last-child {
	border-bottom: none;
}
.gd-visit-date {
	font-size: 13px;
	color: var(--fg);
	font-weight: 500;
}
.gd-visit-items {
	font-size: 13px;
	color: var(--fg-dim);
}
.gd-visit-table {
	font-size: 11px;
	color: var(--fg-mute);
	padding: 2px 7px;
	border: 1px solid var(--border);
	border-radius: 100px;
	background: var(--bg-1);
	width: fit-content;
}
.gd-visit-sum {
	font-size: 13px;
	font-weight: 500;
	letter-spacing: -0.01em;
	text-align: right;
}
.gd-visit-sum .cur {
	font-family: "Onest", sans-serif;
	font-size: 11px;
	color: var(--fg-dim);
	margin-left: 1px;
	font-weight: 400;
}

@media (max-width: 1280px) {
	.loyalty-split {
		grid-template-columns: 1fr;
	}
	.loyalty-list {
		position: static;
		max-height: none;
	}
	.gd-kpi-grid {
		grid-template-columns: 1fr 1fr;
	}
	.gd-kpi {
		border-bottom: 1px solid var(--border);
	}
	.gd-grid {
		grid-template-columns: 1fr;
	}
}
