/* Risk Modal — wraps <risk-calculator> in a global modal overlay.
   Uses .modal-content base from common.css, overrides width for calculator. */

/* The one dialog off the three-size scale, and here is why: the calculator
   puts its inputs beside its results, and at --dialog-width-lg (780px) that
   grid folds under 900px. Widening it is the fix if the layout is ever
   rebuilt; shrinking the dialog is not. */
#risk-modal .modal-content {
	width: 980px;
	max-width: 95vw;
	max-height: 85vh;
	max-height: 85dvh;
	padding: 0;
	display: flex;
	flex-direction: column;
}

.risk-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--space-xs) var(--space-sm);
	background: var(--bg-elevated);
	border-bottom: 1px solid var(--border);
}

.risk-modal-title {
	font-size: var(--font-sm);
	font-weight: 600;
	color: var(--text);
	padding-left: var(--space-xs);
}

.risk-modal-body {
	overflow-y: auto;
	padding: var(--space-md);
	flex: 1;
}

/* Override the grid to fill modal width */
.risk-modal-body .risk-calculator .rc-grid {
	max-width: 100%;
}

/* intentional breakpoint: 640px full-bleeds the risk dialog before the
   768px tablet break, where the calculator grid stops fitting. */
@media (width <= 640px) {
	#risk-modal .modal-content {
		width: 100%;
		max-width: 100vw;
		max-height: var(--viewport-h);
		border-radius: var(--radius-none);
	}

	.risk-modal-body .risk-calculator .rc-grid {
		grid-template-columns: 1fr;
	}
}
