.twcs {
	/* Nilai lalai. Warna sebenar dikawal dari Settings > CIDB Status > Warna. */
	--twcs-primary: #0e7c78;
	--twcs-on-primary: #ffffff;
	--twcs-primary-soft: #e3f2f1;
	--twcs-ring: #8cc9c6;
	--twcs-success: #15803d;
	--twcs-success-soft: #e4f4ea;
	--twcs-danger: #b42318;
	--twcs-danger-soft: #fbe9e7;
	--twcs-ink: #14231b;
	--twcs-muted: #5f6f67;
	--twcs-line: #d5dfdb;
	--twcs-warn: #8a5a00;
	--twcs-warn-soft: #fff4dc;

	max-width: 540px;
	margin: 0 auto;
	color: var(--twcs-ink);
	font-family: inherit;
	line-height: 1.5;
	box-sizing: border-box;
}
.twcs *, .twcs *::before, .twcs *::after { box-sizing: inherit; }
.twcs [hidden] { display: none !important; }

/* Panel */
.twcs .twcs-panel {
	background: #fff;
	border: 1px solid var(--twcs-line);
	border-radius: 18px;
	padding: 20px;
	box-shadow: 0 1px 2px rgba(16, 24, 20, .04), 0 8px 24px rgba(16, 24, 20, .06);
}

/* Tabs (segmented control) */
.twcs .twcs-tabs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 4px;
	padding: 4px;
	margin-bottom: 20px;
	background: var(--twcs-primary-soft);
	border-radius: 12px;
}
.twcs .twcs-tab{
	appearance: none;
	border: 0;
	border-radius: 9px;
	background: transparent;
	color: var(--twcs-primary);
	min-height: 44px;
	padding: 8px 10px;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.25;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease;
}
.twcs .twcs-tab:hover:not(.is-active){ background: rgba(255, 255, 255, .6); }
.twcs .twcs-tab.is-active{ background: var(--twcs-primary); color: var(--twcs-on-primary); }

/* Fields */
.twcs .twcs-group { position: relative; margin-bottom: 16px; }
.twcs .twcs-label{ display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.twcs .twcs-input,
.twcs .twcs-select-native{
	display: block;
	width: 100%;
	min-height: 50px;
	padding: 12px 14px;
	font: inherit;
	font-size: 16px; /* elak zoom automatik pada iOS */
	color: var(--twcs-ink);
	background: #fff;
	border: 1px solid #b8c6c0;
	border-radius: 12px;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.twcs .twcs-input::placeholder{ color: #8a9890; }
.twcs .twcs-input:hover{ border-color: #8fa39a; }
.twcs .twcs-input:focus,
.twcs .twcs-tab:focus-visible,
.twcs .twcs-submit:focus-visible,
.twcs .twcs-btn:focus-visible,
.twcs .twcs-ghost:focus-visible{
	outline: none;
	border-color: var(--twcs-primary);
	box-shadow: 0 0 0 3px var(--twcs-ring);
}
.twcs .twcs-input[aria-invalid="true"]{ border-color: var(--twcs-danger); }
.twcs .twcs-input[aria-invalid="true"]:focus{ box-shadow: 0 0 0 3px var(--twcs-danger-soft); }
.twcs .twcs-msg{ margin: 6px 0 0; font-size: 13px; color: var(--twcs-danger); }

/* Combobox warganegara */
.twcs .twcs-combo { position: relative; }
.twcs .twcs-combo-input{ padding-right: 44px; text-overflow: ellipsis; }
.twcs .twcs-combo-chev{
	position: absolute;
	top: 0;
	right: 0;
	width: 44px;
	height: 50px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}
.twcs .twcs-combo-chev::before{
	content: "";
	width: 8px;
	height: 8px;
	margin-top: -4px;
	border-right: 2px solid var(--twcs-muted);
	border-bottom: 2px solid var(--twcs-muted);
	transform: rotate(45deg);
	transition: transform .15s ease;
}
.twcs .twcs-combo.is-open .twcs-combo-chev::before{ margin-top: 4px; transform: rotate(-135deg); }
.twcs .twcs-combo-list{
	margin: 0;
	padding: 6px;
	list-style: none;
	max-height: 264px;
	overflow-y: auto;
	background: #fff;
	border: 1px solid var(--twcs-line);
	border-radius: 12px;
	box-shadow: 0 12px 32px rgba(16, 24, 20, .14);
}
/* Bekas senarai di <body>: sentiasa di atas footer, header melekit dan seksyen tema */
.twcs.twcs-portal {
	position: absolute;
	z-index: 2147483000;
	max-width: none;
	margin: 0;
	padding: 0;
}
.twcs .twcs-combo-opt,
.twcs .twcs-combo-empty{
	margin: 0;
	padding: 10px 12px;
	border-radius: 8px;
	font-size: 15px;
	line-height: 1.3;
}
.twcs .twcs-combo-opt{ cursor: pointer; }
.twcs .twcs-combo-opt.is-active{ background: var(--twcs-primary-soft); }
.twcs .twcs-combo-opt[aria-selected="true"]{ font-weight: 700; color: var(--twcs-primary); }
.twcs .twcs-combo-empty{ color: var(--twcs-muted); }

/* Butang hantar */
.twcs .twcs-submit {
	appearance: none;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	min-height: 52px;
	margin-top: 4px;
	padding: 12px 18px;
	border: 0;
	border-radius: 12px;
	background: var(--twcs-primary);
	color: var(--twcs-on-primary);
	font: inherit;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	transition: filter .15s ease;
}
.twcs .twcs-submit:hover{ filter: brightness(1.07); }
.twcs .twcs-submit[disabled]{ opacity: .75; cursor: progress; }
.twcs .twcs-spinner{
	display: none;
	width: 18px;
	height: 18px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: twcs-spin .7s linear infinite;
}
.twcs .twcs-submit.is-loading .twcs-spinner{ display: inline-block; }
@keyframes twcs-spin { to { transform: rotate(360deg); } }

.twcs .twcs-hp{ position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Keputusan */
.twcs .twcs-result { margin-top: 20px; scroll-margin-top: 80px; }
.twcs .twcs-result:focus{ outline: none; }

.twcs .twcs-alert{
	display: flex;
	gap: 10px;
	padding: 14px 16px;
	border-radius: 12px;
	background: var(--twcs-danger-soft);
	color: var(--twcs-danger);
	font-size: 14px;
}

.twcs .twcs-card{
	background: #fff;
	border: 1px solid var(--twcs-line);
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(16, 24, 20, .04), 0 8px 24px rgba(16, 24, 20, .06);
	animation: twcs-in .25s ease both;
}
@keyframes twcs-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.twcs .twcs-card-head{
	padding: 14px 20px;
	background: var(--twcs-primary);
	color: var(--twcs-on-primary);
	text-align: center;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: .06em;
}
.twcs .twcs-card-body{ padding: 22px 20px 20px; }
.twcs .twcs-name{
	margin: 0 0 14px;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
	text-align: center;
	word-break: break-word;
	color: var(--twcs-ink);
}

.twcs .twcs-status{
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 18px;
	padding: 14px 16px;
	border-radius: 14px;
}
.twcs .twcs-status.is-active{ background: var(--twcs-success-soft); color: var(--twcs-success); }
.twcs .twcs-status.is-inactive{ background: var(--twcs-danger-soft); color: var(--twcs-danger); }
.twcs .twcs-status.is-unknown{ background: var(--twcs-warn-soft); color: var(--twcs-warn); }
.twcs .twcs-status svg{ flex: none; width: 34px; height: 34px; }
.twcs .twcs-status-label{ font-size: 18px; font-weight: 800; letter-spacing: .02em; line-height: 1.2; }
.twcs .twcs-status-sub{ margin-top: 2px; font-size: 14px; font-weight: 500; }

.twcs .twcs-rows{ margin: 0; }
.twcs .twcs-row-item{
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 16px;
	padding: 12px 0;
	border-top: 1px solid var(--twcs-line);
}
.twcs .twcs-row-item:first-child{ border-top: 0; padding-top: 0; }
.twcs .twcs-row-item dt{ margin: 0; flex: none; font-size: 14px; color: var(--twcs-muted); }
.twcs .twcs-row-item dd{ margin: 0; font-size: 16px; font-weight: 600; text-align: right; word-break: break-word; }
.twcs .twcs-id{ font-variant-numeric: tabular-nums; letter-spacing: .05em; }

.twcs .twcs-empty{ padding: 6px 0 2px; text-align: center; }
.twcs .twcs-empty svg{ width: 44px; height: 44px; margin-bottom: 6px; color: var(--twcs-muted); }
.twcs .twcs-empty strong{ display: block; font-size: 19px; line-height: 1.3; }
.twcs .twcs-empty span{ display: block; margin-top: 4px; font-size: 14px; color: var(--twcs-muted); }

.twcs .twcs-actions{ display: grid; gap: 10px; margin-top: 16px; }
.twcs .twcs-btn{
	display: block;
	padding: 14px 18px;
	border-radius: 12px;
	background: var(--twcs-primary);
	color: var(--twcs-on-primary) !important;
	font-weight: 700;
	text-align: center;
	text-decoration: none !important;
	transition: filter .15s ease;
}
.twcs .twcs-btn:hover{ filter: brightness(1.07); }
.twcs .twcs-ghost{
	appearance: none;
	min-height: 46px;
	padding: 10px 16px;
	border: 1px solid var(--twcs-line);
	border-radius: 12px;
	background: #fff;
	color: var(--twcs-ink);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
.twcs .twcs-ghost:hover{ background: var(--twcs-primary-soft); }

@media (max-width: 420px) {
	.twcs .twcs-panel{ padding: 16px; }
	.twcs .twcs-tab{ font-size: 13px; }
	.twcs .twcs-row-item{ flex-direction: column; gap: 2px; }
	.twcs .twcs-row-item dd{ text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
	.twcs *, .twcs *::before, .twcs *::after { animation: none !important; transition: none !important; }
}

/* Kebal terhadap gaya senarai tema (bullet, margin, ikon ::before) */
.twcs ul.twcs-combo-list,
.twcs ul.twcs-combo-list > li {
	list-style: none !important;
	background-image: none !important;
}
.twcs ul.twcs-combo-list { margin: 0 !important; padding: 6px !important; }
.twcs ul.twcs-combo-list > li { margin: 0 !important; padding: 10px 12px !important; }
.twcs ul.twcs-combo-list > li::before,
.twcs ul.twcs-combo-list > li::after { content: none !important; display: none !important; }
.twcs ul.twcs-combo-list > li::marker { content: none; font-size: 0; }
