/* Govt Salary Calculator */
.gsc {
	--gsc-accent: #1f5f8b;
	--gsc-ink: #17233a;
	--gsc-muted: #5a6577;
	--gsc-rule: #d8dde5;
	--gsc-paper: #ffffff;
	--gsc-field: #f5f7fa;
	--gsc-slip: #fbfcfd;
	color: var(--gsc-ink);
	font-size: 16px;
	line-height: 1.5;
	max-width: 1080px;
	margin: 0 auto 2rem;
}
.gsc *, .gsc *::before, .gsc *::after { box-sizing: border-box; }

/* Tabs */
.gsc-tabs {
	display: flex;
	gap: 4px;
	overflow-x: auto;
	border-bottom: 2px solid var(--gsc-rule);
	margin-bottom: 1.5rem;
	scrollbar-width: none;
}
.gsc-tabs::-webkit-scrollbar { display: none; }
.gsc .gsc-tab {
	appearance: none;
	background: none;
	border: 0;
	border-bottom: 3px solid transparent;
	margin-bottom: -2px;
	padding: .7rem 1rem;
	font: inherit;
	font-weight: 600;
	color: var(--gsc-muted);
	white-space: nowrap;
	cursor: pointer;
	border-radius: 0;
	box-shadow: none;
	text-transform: none;
	letter-spacing: 0;
}
.gsc .gsc-tab:hover { color: var(--gsc-ink); background: none; }
.gsc .gsc-tab[aria-selected="true"] { color: var(--gsc-accent); border-bottom-color: var(--gsc-accent); }
.gsc .gsc-tab:focus-visible { outline: 2px solid var(--gsc-accent); outline-offset: -2px; }

/* Heading */
.gsc-head { margin-bottom: 1.25rem; max-width: 62ch; }
.gsc .gsc-title { font-size: 1.45rem; line-height: 1.25; margin: 0 0 .35rem; color: var(--gsc-ink); }
.gsc-sub { margin: 0; color: var(--gsc-muted); }

/* Layout */
.gsc-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
	gap: 2rem;
	align-items: start;
}
@media (max-width: 820px) {
	.gsc-grid { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
}

/* Fields */
.gsc-form { display: grid; gap: 1.1rem; }
.gsc-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 480px) { .gsc-row2 { grid-template-columns: 1fr; } }
.gsc-field { margin: 0; padding: 0; border: 0; min-width: 0; }
.gsc-field > label, .gsc-field > legend {
	display: block;
	font-weight: 600;
	font-size: .92rem;
	margin: 0 0 .35rem;
	padding: 0;
}
.gsc select, .gsc input[type="number"] {
	width: 100%;
	min-height: 46px;
	padding: .55rem .75rem;
	font: inherit;
	color: var(--gsc-ink);
	background: var(--gsc-field);
	border: 1px solid var(--gsc-rule);
	border-radius: 8px;
	box-shadow: none;
	margin: 0;
}
.gsc select:focus, .gsc input:focus { outline: 2px solid var(--gsc-accent); outline-offset: 1px; border-color: var(--gsc-accent); background: var(--gsc-paper); }
.gsc input[type="number"] { -moz-appearance: textfield; }
.gsc input[type="number"]::-webkit-inner-spin-button { opacity: .4; }

.gsc-prefix, .gsc-suffix { display: flex; align-items: stretch; }
.gsc-prefix > span, .gsc-suffix > span {
	display: flex; align-items: center;
	padding: 0 .7rem;
	background: var(--gsc-paper);
	border: 1px solid var(--gsc-rule);
	color: var(--gsc-muted);
	white-space: nowrap;
	font-size: .92rem;
}
.gsc-prefix > span { border-right: 0; border-radius: 8px 0 0 8px; }
.gsc-prefix input { border-radius: 0 8px 8px 0 !important; }
.gsc-suffix > span { border-left: 0; border-radius: 0 8px 8px 0; }
.gsc-suffix input { border-radius: 8px 0 0 8px !important; }

.gsc-check label { display: flex; gap: .55rem; align-items: center; font-weight: 500; cursor: pointer; margin: 0; }
.gsc-check input { width: 18px; height: 18px; accent-color: var(--gsc-accent); margin: 0; }

.gsc-help { margin: .35rem 0 0; font-size: .85rem; color: var(--gsc-muted); }
.gsc details.gsc-help summary { cursor: pointer; color: var(--gsc-accent); }

/* Segmented city control */
.gsc-seg { display: flex; flex-wrap: wrap; border: 1px solid var(--gsc-rule); border-radius: 8px; overflow: hidden; background: var(--gsc-field); }
.gsc-seg label { flex: 1 1 auto; position: relative; margin: 0; cursor: pointer; }
.gsc-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.gsc-seg span { display: block; text-align: center; padding: .65rem .8rem; font-weight: 600; border-right: 1px solid var(--gsc-rule); white-space: nowrap; }
.gsc-seg label:last-child span { border-right: 0; }
.gsc-seg input:checked + span { background: var(--gsc-accent); color: #fff; }
.gsc-seg input:focus-visible + span { outline: 2px solid var(--gsc-accent); outline-offset: -4px; box-shadow: inset 0 0 0 4px #fff; }

/* Expandable extras */
.gsc-more { border-top: 1px solid var(--gsc-rule); padding-top: .9rem; }
.gsc-more > summary { cursor: pointer; font-weight: 600; color: var(--gsc-accent); }
.gsc-more[open] > summary { margin-bottom: 1rem; }
.gsc-more > .gsc-field, .gsc-more > .gsc-row2 { margin-bottom: 1rem; }

/* Range */
.gsc input[type="range"] { width: 100%; accent-color: var(--gsc-accent); margin: .4rem 0 .2rem; }
.gsc output { font-variant-numeric: tabular-nums; color: var(--gsc-accent); margin-left: .35rem; }
.gsc-range-ends { display: flex; justify-content: space-between; font-size: .8rem; color: var(--gsc-muted); }

/* The pay slip – the result */
.gsc-slip {
	position: sticky;
	top: 1.5rem;
	background: var(--gsc-slip);
	border: 1px solid var(--gsc-rule);
	border-radius: 4px;
	padding: 1.4rem 1.4rem 1.1rem;
	font-variant-numeric: tabular-nums;
	/* perforated top edge, like a printed salary slip */
	background-image: radial-gradient(circle at 6px 0, transparent 4px, var(--gsc-slip) 4.5px);
	background-size: 14px 100%;
	background-repeat: repeat-x;
	background-color: transparent;
	border-top: 0;
}
.gsc-slip-top {
	display: flex; justify-content: space-between; gap: 1rem;
	padding-bottom: .7rem;
	margin-bottom: .9rem;
	border-bottom: 2px solid var(--gsc-ink);
	font-weight: 700;
}
.gsc-slip-top span:last-child { color: var(--gsc-accent); }
.gsc-slip-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
@media (max-width: 560px) { .gsc-slip-cols { grid-template-columns: 1fr; } }

.gsc table.gsc-lines { width: 100%; border-collapse: collapse; margin: 0; border: 0; font-size: .93rem; }
.gsc .gsc-lines caption { text-align: left; font-weight: 700; padding: 0 0 .4rem; color: var(--gsc-muted); font-size: .85rem; }
.gsc .gsc-lines th, .gsc .gsc-lines td { padding: .38rem 0; border: 0; border-bottom: 1px dotted var(--gsc-rule); background: none; vertical-align: top; }
.gsc .gsc-lines th { text-align: left; font-weight: 400; padding-right: .75rem; }
.gsc .gsc-lines td { text-align: right; white-space: nowrap; }
.gsc .gsc-lines tfoot th, .gsc .gsc-lines tfoot td { font-weight: 700; border-bottom: 0; border-top: 1px solid var(--gsc-ink); padding-top: .5rem; }
.gsc .gsc-lines tr.gsc-strong th, .gsc .gsc-lines tr.gsc-strong td { font-weight: 700; }
.gsc-lines-wide { font-size: 1rem !important; }

.gsc-net {
	display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap;
	margin-top: 1.1rem;
	padding: 1rem 1.1rem;
	background: var(--gsc-accent);
	color: #fff;
	border-radius: 4px;
}
.gsc-net span { font-weight: 600; }
.gsc-net strong { font-size: clamp(1.6rem, 4vw, 2.1rem); line-height: 1.1; letter-spacing: -.01em; }
.gsc-slip-foot { margin: .8rem 0 0; font-size: .84rem; color: var(--gsc-muted); }

/* Tables: DA history and pay matrix */
.gsc-history { margin-top: 2rem; border-top: 1px solid var(--gsc-rule); padding-top: 1rem; }
.gsc-history > summary { cursor: pointer; font-weight: 700; }
.gsc-history .gsc-scroll { margin-top: .8rem; max-width: 520px; }
.gsc-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.gsc-scroll:focus-visible { outline: 2px solid var(--gsc-accent); }
.gsc table.gsc-table { width: 100%; border-collapse: collapse; margin: 0; font-variant-numeric: tabular-nums; font-size: .9rem; border: 0; }
.gsc .gsc-table th, .gsc .gsc-table td { padding: .45rem .7rem; border: 0; border-bottom: 1px solid var(--gsc-rule); text-align: right; white-space: nowrap; background: none; }
.gsc .gsc-table thead th { background: var(--gsc-field); font-weight: 700; position: sticky; top: 0; }
.gsc .gsc-table th:first-child, .gsc .gsc-table td:first-child { text-align: left; }

.gsc-matrix-pick { max-width: 320px; margin-bottom: 1rem; }
.gsc-matrix-wrap { max-height: 70vh; border: 1px solid var(--gsc-rule); border-radius: 4px; }
.gsc .gsc-matrix tbody th { position: sticky; left: 0; background: var(--gsc-paper); font-weight: 600; color: var(--gsc-muted); }
.gsc .gsc-matrix thead th:first-child { left: 0; z-index: 2; }
.gsc .gsc-matrix tbody tr:nth-child(even) td { background: var(--gsc-slip); }
.gsc .has-pick .gsc-matrix td:not(.is-on) { color: #9aa3b1; }
.gsc .gsc-matrix .is-on { color: var(--gsc-ink); font-weight: 700; }
.gsc .gsc-matrix thead th.is-on { background: var(--gsc-accent); color: #fff; }

.gsc-note { margin: 1.5rem 0 0; font-size: .82rem; color: var(--gsc-muted); max-width: 75ch; }

@media (prefers-reduced-motion: reduce) {
	.gsc * { scroll-behavior: auto !important; }
}
