/*
 * Visual design matches the "Scale Ready Supplier Canvas" mockup: a white
 * rounded card per area, colored 3px accent border + light accent header
 * background per category, centered header/subtitle, gradient Growth
 * Pathway footer. Area-to-color mapping is fixed by area number (see
 * TSRC_Shortcode::AREAS): 1 Connections (yellow), 2 Capital (cyan),
 * 3 Competency (blue), 4 Capacity (red), 5 Buyer Perspective (green).
 */

.tsrc-canvas-wrap {
	--tsrc-accent: #0f172a;
	background: #ffffff;
	border: none;
	border-radius: 16px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
	padding: 28px 32px 32px;
}

.tsrc-canvas-header {
	text-align: center;
	margin-bottom: 20px;
}

.tsrc-canvas-title-bar {
	font-size: 22px;
	font-weight: 800;
	color: #0f172a;
	margin: 0;
	letter-spacing: 0.01em;
}

.tsrc-canvas-subtitle {
	font-size: 13px;
	color: #64748b;
	margin: 4px 0 0;
}

.tsrc-canvas {
	--tsrc-accent: #0f172a;
	display: flex;
	flex-direction: column;
	gap: 20px;
	height: 640px;
	box-sizing: border-box;
}

.tsrc-canvas-grid {
	display: flex;
	gap: 20px;
	flex: 1;
	min-height: 0;
}

.tsrc-col {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.tsrc-area {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
	overflow: hidden;
}

.tsrc-area-header {
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	border-bottom: 3px solid var(--tsrc-border, #cbd5e1);
	background: var(--tsrc-header-bg, #f1f5f9);
	color: var(--tsrc-header-fg, #334155);
	flex-shrink: 0;
}

.tsrc-area-heading {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.tsrc-area-label {
	font-weight: 700;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.tsrc-area-subtitle {
	font-size: 11px;
	font-weight: 500;
	font-style: italic;
	opacity: 0.75;
	margin-top: 2px;
}

/* Category accents, keyed by the fixed area number. */
.tsrc-area-1 .tsrc-area-header { --tsrc-border: #eab308; --tsrc-header-bg: #fef9c3; --tsrc-header-fg: #854d0e; }
.tsrc-area-3 .tsrc-area-header { --tsrc-border: #3b82f6; --tsrc-header-bg: #dbeafe; --tsrc-header-fg: #1e40af; }
.tsrc-area-5 .tsrc-area-header { --tsrc-border: #22c55e; --tsrc-header-bg: #dcfce7; --tsrc-header-fg: #166534; }
.tsrc-area-2 .tsrc-area-header { --tsrc-border: #06b6d4; --tsrc-header-bg: #ecfeff; --tsrc-header-fg: #155e75; }
.tsrc-area-4 .tsrc-area-header { --tsrc-border: #ef4444; --tsrc-header-bg: #fee2e2; --tsrc-header-fg: #991b1b; }

/* Buyer Perspective's heading is centered (matching the mockup), with the
   help icon floated to the right edge independently so it doesn't skew
   the centering. */
.tsrc-area-5 .tsrc-area-header {
	position: relative;
	justify-content: center;
}

.tsrc-area-5 .tsrc-area-heading {
	align-items: center;
	text-align: center;
	padding: 0 28px;
}

.tsrc-area-5 .tsrc-help-icon {
	position: absolute;
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
}

.tsrc-help-icon {
	background: transparent;
	color: currentColor;
	opacity: 0.65;
	border: none;
	border-radius: 50%;
	width: 22px;
	height: 22px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
	transition: opacity 0.15s, background 0.15s;
}

.tsrc-help-icon:hover,
.tsrc-help-icon:focus-visible {
	opacity: 1;
	background: rgba(0, 0, 0, 0.08);
}

.tsrc-area-body {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	padding: 14px 16px;
	overflow-wrap: anywhere;
}

.tsrc-area-body p {
	margin: 0 0 10px;
	font-size: 13px;
	line-height: 1.5;
	color: #334155;
}

.tsrc-area-body p:last-child {
	margin-bottom: 0;
}

.tsrc-empty {
	color: #94a3b8;
	font-style: italic;
}

.tsrc-tooltip-popover {
	position: absolute;
	max-width: 260px;
	background: #fff;
	color: #1e293b;
	border: 1px solid #e2e8f0;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
	padding: 10px 12px;
	font-size: 13px;
	line-height: 1.4;
	z-index: 100000;
	border-radius: 8px;
}

/* Footer Pathway bar */

.tsrc-pathway {
	flex-shrink: 0;
	background: linear-gradient(90deg, #f8fafc, #e2e8f0);
	border: 1px solid #cbd5e1;
	border-radius: 12px;
	padding: 16px 20px;
	text-align: center;
}

.tsrc-pathway h3 {
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #0f172a;
	font-weight: 700;
	margin: 0;
}

.tsrc-pathway p {
	font-size: 13px;
	color: #475569;
	margin: 4px 0 0;
}

/* Button mode */

.tsrc-open-btn {
	background: var(--tsrc-accent, #0f172a);
	color: #fff;
	border: none;
	padding: 10px 18px;
	font-size: 14px;
	cursor: pointer;
	border-radius: 6px;
}

.tsrc-open-btn:hover {
	opacity: 0.9;
}

.tsrc-modal[hidden] {
	display: none !important;
}

.tsrc-modal-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 99998;
}

.tsrc-modal-window {
	position: fixed;
	top: 0;
	left: 0;
	width: 900px;
	height: 640px;
	min-width: 700px;
	min-height: 500px;
	max-width: 98vw;
	max-height: 98vh;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
	z-index: 99999;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.tsrc-modal-titlebar {
	background: var(--tsrc-accent, #0f172a);
	color: #fff;
	padding: 10px 14px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: move;
	user-select: none;
	flex-shrink: 0;
}

.tsrc-modal-title {
	font-weight: 600;
}

.tsrc-modal-close {
	background: transparent;
	border: none;
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
}

.tsrc-modal-body {
	flex: 1;
	min-height: 0;
	padding: 16px;
	overflow: hidden;
	display: flex;
	background: #ffffff;
}

.tsrc-modal-body .tsrc-canvas {
	height: auto;
	flex: 1;
}

.tsrc-modal-resize-handle {
	position: absolute;
	right: 0;
	bottom: 0;
	width: 20px;
	height: 20px;
	display: flex;
	align-items: flex-end;
	justify-content: flex-end;
	padding: 2px;
	box-sizing: border-box;
	color: #9a9a9a;
	cursor: nwse-resize;
	transition: color 0.15s;
}

.tsrc-modal-resize-handle:hover {
	color: #555;
}
