/**
 * TBL 銘柄ウォッチ - フロントエンドスタイル
 * 全クラスを .tbl-sw 配下にスコープしてWordPressテーマとの衝突を回避
 */

.tbl-sw {
	--tbl-sw-bg: #f4f6fb;
	--tbl-sw-card: #ffffff;
	--tbl-sw-text: #1a2233;
	--tbl-sw-text-sub: #6b7689;
	--tbl-sw-accent: #2563eb;
	--tbl-sw-accent-soft: #dbe9ff;
	--tbl-sw-gain: #16a34a;
	--tbl-sw-gain-soft: #dcfce7;
	--tbl-sw-loss: #dc2626;
	--tbl-sw-loss-soft: #fee2e2;
	--tbl-sw-neutral: #64748b;
	--tbl-sw-border: #e5e9f0;
	--tbl-sw-shadow: 0 4px 14px rgba(20, 30, 60, 0.06);

	font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
	color: var(--tbl-sw-text);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	max-width: 1100px;
	margin: 24px auto;
	padding: 0;
	box-sizing: border-box;
}

.tbl-sw *,
.tbl-sw *::before,
.tbl-sw *::after {
	box-sizing: border-box;
}

.tbl-sw p {
	margin: 0;
}

/* ヘッダー */
.tbl-sw-header {
	background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
	color: #fff;
	padding: 28px 24px 22px;
	border-radius: 14px;
	margin-bottom: 22px;
	box-shadow: var(--tbl-sw-shadow);
}
.tbl-sw-title {
	font-size: 22px;
	font-weight: 700;
	margin: 0 0 4px;
	color: #fff;
	letter-spacing: 0.02em;
	line-height: 1.4;
}
.tbl-sw-subtitle {
	font-size: 13px;
	opacity: 0.9;
	margin: 0;
}
.tbl-sw-update {
	margin-top: 10px;
	font-size: 12px;
	opacity: 0.8;
}

/* サマリー */
.tbl-sw-summary {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 14px;
	margin-bottom: 22px;
}
.tbl-sw-card {
	background: var(--tbl-sw-card);
	border-radius: 14px;
	padding: 18px 18px 16px;
	box-shadow: var(--tbl-sw-shadow);
	border: 1px solid var(--tbl-sw-border);
}
.tbl-sw-label {
	font-size: 12px;
	color: var(--tbl-sw-text-sub);
	margin: 0 0 6px !important;
}
.tbl-sw-value {
	font-size: 22px;
	font-weight: 700;
	margin: 0 !important;
	letter-spacing: 0.01em;
	line-height: 1.3;
}
.tbl-sw-sub {
	font-size: 12px;
	color: var(--tbl-sw-text-sub);
	margin: 4px 0 0 !important;
}

.tbl-sw-gain { color: var(--tbl-sw-gain) !important; }
.tbl-sw-loss { color: var(--tbl-sw-loss) !important; }
.tbl-sw-neutral { color: var(--tbl-sw-neutral) !important; }

/* 月別ブロック */
.tbl-sw-block {
	margin-bottom: 14px;
}
.tbl-sw-block + .tbl-sw-block {
	margin-top: 30px;
	padding-top: 26px;
	border-top: 1px solid var(--tbl-sw-border);
}
.tbl-sw-month {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 16px;
}
.tbl-sw-month-title {
	font-size: 17px;
	font-weight: 700;
	margin: 0;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--tbl-sw-text);
	padding-left: 12px;
	border-left: 4px solid var(--tbl-sw-accent);
	line-height: 1.4;
}
.tbl-sw-block-other .tbl-sw-month-title {
	color: var(--tbl-sw-text-sub);
	border-left-color: #f59e0b;
}
.tbl-sw-other-note {
	margin-top: 0 !important;
	margin-bottom: 16px;
}

/* セクションタイトル */
.tbl-sw-section-title {
	font-size: 15px;
	font-weight: 700;
	margin: 0 0 12px;
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--tbl-sw-text);
}
.tbl-sw-badge {
	font-size: 11px;
	background: var(--tbl-sw-accent-soft);
	color: var(--tbl-sw-accent);
	padding: 2px 8px;
	border-radius: 10px;
	font-weight: 600;
}

/* ハイライト */
.tbl-sw-highlight {
	background: linear-gradient(135deg, #fff8e6 0%, #ffffff 100%);
	border: 1px solid #fcd34d;
	border-radius: 14px;
	padding: 16px 18px;
	margin-bottom: 22px;
	display: flex;
	align-items: center;
	gap: 14px;
}
.tbl-sw-highlight-icon {
	font-size: 28px;
	line-height: 1;
}
.tbl-sw-highlight-text {
	flex: 1;
}
.tbl-sw-highlight-title {
	font-weight: 700;
	font-size: 14px;
	margin: 0 0 2px !important;
	color: var(--tbl-sw-text);
}
.tbl-sw-highlight-desc {
	font-size: 13px;
	color: var(--tbl-sw-text-sub);
	margin: 0 !important;
}

/* 銘柄グリッド */
.tbl-sw-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 14px;
}
.tbl-sw-stock {
	background: var(--tbl-sw-card);
	border-radius: 14px;
	padding: 18px;
	box-shadow: var(--tbl-sw-shadow);
	border: 1px solid var(--tbl-sw-border);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tbl-sw-stock:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 22px rgba(20, 30, 60, 0.10);
}

.tbl-sw-stock-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 12px;
}
.tbl-sw-stock-info {
	min-width: 0;
	flex: 1;
}
.tbl-sw-stock-name {
	font-weight: 700;
	font-size: 16px;
	margin: 0 !important;
	color: var(--tbl-sw-text);
	line-height: 1.4;
}
.tbl-sw-stock-code {
	font-size: 12px;
	color: var(--tbl-sw-text-sub);
	margin: 2px 0 0 !important;
}
.tbl-sw-stock-meta {
	font-size: 12px;
	color: var(--tbl-sw-text-sub);
	margin: 4px 0 0 !important;
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}
.tbl-sw-days {
	background: var(--tbl-sw-accent-soft);
	color: var(--tbl-sw-accent);
	padding: 1px 7px;
	border-radius: 8px;
	font-weight: 600;
	font-size: 11px;
}

.tbl-sw-pct {
	font-size: 18px;
	font-weight: 700;
	padding: 4px 10px;
	border-radius: 10px;
	white-space: nowrap;
	background: #e2e8f0;
	color: var(--tbl-sw-neutral);
}
.tbl-sw-pct.tbl-sw-gain { background: var(--tbl-sw-gain-soft); color: var(--tbl-sw-gain) !important; }
.tbl-sw-pct.tbl-sw-loss { background: var(--tbl-sw-loss-soft); color: var(--tbl-sw-loss) !important; }

.tbl-sw-prices {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin: 10px 0 12px;
}
.tbl-sw-lbl {
	font-size: 11px;
	color: var(--tbl-sw-text-sub);
	margin: 0 !important;
}
.tbl-sw-val {
	font-size: 16px;
	font-weight: 600;
	margin: 2px 0 0 !important;
	color: var(--tbl-sw-text);
}

.tbl-sw-pnl {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 12px;
	background: #f8fafc;
	border-radius: 10px;
	margin-bottom: 10px;
}
.tbl-sw-pnl .tbl-sw-lbl {
	font-size: 12px;
}
.tbl-sw-pnl .tbl-sw-val {
	font-size: 15px;
	font-weight: 700;
	margin: 0 !important;
}

.tbl-sw-spark {
	display: block;
	width: 100%;
	height: 44px;
	margin-top: 6px;
}

.tbl-sw-day {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 12px;
	color: var(--tbl-sw-text-sub);
	margin-top: 8px;
	padding-top: 10px;
	border-top: 1px dashed var(--tbl-sw-border);
}
.tbl-sw-day .tbl-sw-val {
	font-size: 12px;
	font-weight: 600;
	margin: 0 !important;
}

.tbl-sw-warn {
	margin-top: 10px !important;
	padding: 8px 10px;
	background: #fef3c7;
	border: 1px solid #fde68a;
	border-radius: 8px;
	font-size: 12px;
	color: #78350f;
}

.tbl-sw-footer {
	text-align: center;
	color: var(--tbl-sw-text-sub) !important;
	font-size: 12px;
	margin-top: 28px !important;
	line-height: 1.7;
}

.tbl-sw-empty {
	background: var(--tbl-sw-card);
	border: 1px solid var(--tbl-sw-border);
	border-radius: 14px;
	padding: 24px;
	text-align: center;
	color: var(--tbl-sw-text-sub);
}

/* レスポンシブ */
@media (max-width: 720px) {
	.tbl-sw-summary {
		grid-template-columns: repeat(2, 1fr);
	}
	.tbl-sw-title {
		font-size: 19px;
	}
	.tbl-sw-header {
		padding: 22px 18px 18px;
	}
}
