.gd-matrix { max-width: 760px; margin: 0 auto; padding: 1.25rem; background: #fff; color: #1d2327; border-radius: 8px; box-sizing: border-box; }
.gd-matrix label, .gd-matrix th, .gd-matrix td, .gd-matrix p { color: #1d2327; }
.gd-lookup { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; margin-bottom: .75rem; }
.gd-lookup label { flex-basis: 100%; font-weight: 600; }
.gd-lookup input { flex: 1 1 12rem; padding: .6rem; font-size: 1rem; background: #fff; color: #1d2327; border: 1px solid #8c8f94; border-radius: 4px; }
.gd-name { margin: 0 0 .75rem; font-size: 1.2em; font-weight: 700; }
.gd-message { min-height: 1.5em; margin: .25rem 0 .75rem; }
.gd-error { color: #b32d2e; }

.gd-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.gd-table th, .gd-table td { border: 1px solid #d0d5dd; padding: .5rem; text-align: center; vertical-align: middle; }
.gd-table th.gd-level { text-align: left; }
.gd-level-desc { display: block; font-weight: 400; font-size: .85em; opacity: .8; }

.gd-cell { width: 100%; padding: .75rem .25rem; background: #fff; border: 2px solid #d0d5dd; border-radius: 6px; cursor: pointer; font: inherit; }
.gd-cell:hover, .gd-cell:focus { border-color: #1d6fb8; outline: none; }
.gd-cell:focus-visible { outline: 3px solid #1d6fb8; outline-offset: 2px; }
.gd-cell.gd-selected-cell { border-color: #1d6fb8; background: #e8f1fb; }
.gd-regular { display: block; text-decoration: line-through; opacity: .65; font-size: .85em; }
.gd-price { display: block; font-weight: 700; font-size: 1.15em; }

.gd-add { margin-top: 1rem; }
.gd-selected { font-weight: 600; }
.gd-asof { font-size: .85em; opacity: .75; }

/* Phones: each level becomes a stacked block; each term is a labelled row. */
@media (max-width: 640px) {
	.gd-table, .gd-table tbody, .gd-table tr, .gd-table th, .gd-table td { display: block; width: 100%; }
	.gd-table tr:first-child { position: absolute; left: -9999px; }
	.gd-table tr { margin-bottom: 1rem; border: 1px solid #d0d5dd; }
	.gd-table th, .gd-table td { border: 0; }
	.gd-table td { display: flex; align-items: center; gap: .75rem; }
	.gd-table td::before { content: attr(data-label); flex: 0 0 5.5rem; text-align: left; font-weight: 600; }
	.gd-cell { flex: 1 1 auto; }
}
