/* public/stock-quotes — 위젯 + 상세 */

.tr-stq {
	--tr-stq-border: var(--border-color, #e5e7ea);
	--tr-stq-card-bg: var(--bg-primary, #fff);
	--tr-stq-text: var(--text-primary, #18191a);
	--tr-stq-muted: var(--text-secondary, #6c757d);
	--tr-stq-up: var(--exchange-diff-up, #c0392b);
	--tr-stq-down: var(--exchange-diff-down, #2980b9);
	box-sizing: border-box;
	margin: 10px 0 12px;
}
.tr-stq *,
.tr-stq *::before,
.tr-stq *::after { box-sizing: border-box; }

.tr-stq__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
	margin: 0 0 8px;
}
.tr-stq__title {
	margin: 0;
	font-size: 1em;
	font-weight: 700;
	color: var(--tr-stq-text);
}
.tr-stq__more {
	font-size: 0.92em;
	font-weight: 700;
	color: var(--color-accent, #b91c1c);
	text-decoration: none;
	white-space: nowrap;
}
.tr-stq__more:hover { text-decoration: underline; }

.tr-stq__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}
@media (min-width: 768px) {
	.tr-stq__grid { grid-template-columns: repeat(3, 1fr); }
}
.tr-stq__card {
	background: var(--tr-stq-card-bg);
	border: 1px solid var(--tr-stq-border);
	border-radius: 6px;
	padding: 10px 12px;
}
.tr-stq__card-head {
	display: flex;
	justify-content: space-between;
	gap: 6px;
	margin-bottom: 4px;
}
.tr-stq__name { font-weight: 700; font-size: 0.9em; }
.tr-stq__code { font-size: 0.75em; color: var(--tr-stq-muted); }
.tr-stq__rate {
	font-size: 1.1em;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	margin-bottom: 2px;
}
.tr-stq__won { font-size: 0.75em; font-weight: 600; }
.tr-stq__diff { font-size: 0.78em; }
.tr-stq__diff.is-up { color: var(--tr-stq-up); }
.tr-stq__diff.is-down { color: var(--tr-stq-down); }
.tr-stq__date,
.tr-stq__disclaimer,
.tr-stq__empty {
	margin: 8px 0 0;
	font-size: 0.78em;
	color: var(--tr-stq-muted);
	line-height: 1.4;
}

/* ---- 상세 ---- */
.tr-stq-page {
	max-width: 960px;
	margin: 0 auto;
	padding: 24px 16px 48px;
}
.tr-stq-page__hero h1 {
	margin: 0 0 8px;
	font-size: 1.6rem;
	font-weight: 800;
	letter-spacing: -0.02em;
}
.tr-stq-page__meta {
	margin: 0 0 6px;
	color: var(--tr-stq-muted);
	font-size: 0.95em;
}
.tr-stq-page__note,
.tr-stq-page__source {
	margin: 0 0 20px;
	font-size: 0.82em;
	color: var(--tr-stq-muted);
	line-height: 1.45;
}
.tr-stq-page__source { margin-top: 28px; }
.tr-stq-page__section-title {
	margin: 28px 0 10px;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--press-rule, #b91c1c);
	font-size: 1.15rem;
	font-weight: 800;
}
.tr-stq-page-top { margin: 0 0 20px; }
.tr-stq-page-top .tr-stq { margin: 0; }

.tr-stq-table-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin-bottom: 12px;
}
.tr-stq-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.88em;
	min-width: 720px;
}
.tr-stq-table th,
.tr-stq-table td {
	padding: 8px 10px;
	border-bottom: 1px solid var(--tr-stq-border);
	text-align: left;
	vertical-align: middle;
}
.tr-stq-table th {
	background: var(--footer-bg, #f4f5f7);
	font-weight: 700;
	white-space: nowrap;
}
.tr-stq-table a {
	color: var(--text-primary, #18191a);
	font-weight: 700;
	text-decoration: none;
}
.tr-stq-table a:hover { color: var(--press-rule, #b91c1c); text-decoration: underline; }
.tr-stq-num {
	font-variant-numeric: tabular-nums;
	text-align: right !important;
	white-space: nowrap;
}
.tr-stq-diff.is-up { color: var(--tr-stq-up); }
.tr-stq-diff.is-down { color: var(--tr-stq-down); }

.tr-stq-chart {
	scroll-margin-top: 72px;
}
.tr-stq-chart__controls {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 10px;
}
.tr-stq-chart__controls label {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 0.85em;
}
.tr-stq-chart__controls select {
	padding: 6px 8px;
	border-radius: 6px;
	border: 1px solid var(--border-color, #d0d5dd);
}
.tr-stq-chart__periods {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0 0 14px;
}
.tr-stq-chart__periods-label {
	margin: 0 4px 0 0;
	font-size: 0.85em;
	font-weight: 700;
}
.tr-stq-chart__period-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 3.2em;
	padding: 7px 12px;
	border: 1px solid var(--tr-stq-border);
	border-radius: 6px;
	background: var(--tr-stq-card-bg);
	color: var(--tr-stq-text);
	font-size: 0.88em;
	font-weight: 600;
	text-decoration: none;
	line-height: 1.2;
}
.tr-stq-chart__period-btn:hover {
	border-color: var(--press-rule, #b91c1c);
}
.tr-stq-chart__period-btn.is-active {
	border-color: var(--press-rule, #b91c1c);
	background: var(--press-rule, #b91c1c);
	color: #fff;
}
.tr-stq-chart__canvas-wrap {
	position: relative;
	width: 100%;
	max-height: 280px;
}
.tr-stq-chart__caption,
.tr-stq-chart__empty {
	margin: 8px 0 0;
	font-size: 0.82em;
	color: var(--tr-stq-muted);
}
