/* Nirmio UI components. Uses tokens only (see tokens.css). */

/* ---------- Buttons ---------- */
.n-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--n-space-2);
	min-height: var(--n-control-height);
	padding: 0 var(--n-space-4);
	border: 1px solid transparent;
	border-radius: var(--n-radius-md);
	font-size: var(--n-font-size-md);
	font-weight: var(--n-font-weight-semibold);
	line-height: 1;
	white-space: nowrap;
	text-decoration: none;
	cursor: pointer;
	transition: background-color var(--n-transition-fast), border-color var(--n-transition-fast), color var(--n-transition-fast), box-shadow var(--n-transition-fast);
}

.n-btn:hover {
	text-decoration: none;
}

.n-btn:focus-visible {
	outline: none;
	box-shadow: var(--n-focus-ring);
}

.n-btn--primary {
	background: var(--n-color-primary);
	color: var(--n-color-primary-contrast);
	box-shadow: var(--n-shadow-xs);
}

.n-btn--primary:hover {
	background: var(--n-color-primary-hover);
	color: var(--n-color-primary-contrast);
}

.n-btn--secondary {
	background: var(--n-color-surface);
	border-color: var(--n-color-border-strong);
	color: var(--n-color-text);
	box-shadow: var(--n-shadow-xs);
}

.n-btn--secondary:hover {
	background: var(--n-color-surface-secondary);
	color: var(--n-color-text);
}

.n-btn--ghost {
	background: transparent;
	color: var(--n-color-text-secondary);
}

.n-btn--ghost:hover {
	background: var(--n-color-surface-secondary);
	color: var(--n-color-text);
}

.n-btn--danger {
	background: var(--n-color-error);
	color: var(--n-color-text-inverse);
}

.n-btn--danger:hover {
	background: var(--n-color-error-hover);
	color: var(--n-color-text-inverse);
}

.n-btn--sm {
	min-height: var(--n-control-height-sm);
	padding: 0 var(--n-space-3);
	font-size: var(--n-font-size-sm);
}

.n-btn--lg {
	min-height: var(--n-control-height-lg);
	padding: 0 var(--n-space-6);
	font-size: var(--n-font-size-base);
}

.n-btn--block {
	width: 100%;
}

.n-btn--icon {
	width: var(--n-control-height);
	padding: 0;
}

.n-btn--icon.n-btn--sm {
	width: var(--n-control-height-sm);
}

.n-btn[disabled],
.n-btn[aria-disabled="true"] {
	opacity: 0.55;
	cursor: not-allowed;
	box-shadow: none;
}

.n-btn[aria-busy="true"] {
	cursor: progress;
}

.n-btn[aria-busy="true"] .n-btn__label {
	opacity: 0.7;
}

/* ---------- Spinner / loading ---------- */
.n-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: n-spin 0.7s linear infinite;
	flex: none;
}

.n-spinner--lg {
	width: 28px;
	height: 28px;
	border-width: 3px;
	color: var(--n-color-primary);
}

@keyframes n-spin {
	to {
		transform: rotate(360deg);
	}
}

.n-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: var(--n-space-3);
	padding: var(--n-space-12) var(--n-space-4);
	color: var(--n-color-text-secondary);
	font-size: var(--n-font-size-md);
}

@media (prefers-reduced-motion: reduce) {
	.n-spinner {
		animation-duration: 2s;
	}
}

/* ---------- Skeleton ---------- */
.n-skeleton {
	display: block;
	background: linear-gradient(90deg, var(--n-color-surface-secondary) 0%, var(--n-color-bg) 50%, var(--n-color-surface-secondary) 100%);
	background-size: 200% 100%;
	border-radius: var(--n-radius-sm);
	animation: n-shimmer 1.4s ease-in-out infinite;
}

.n-skeleton--text {
	height: 0.8em;
	margin: 0.35em 0;
}

.n-skeleton--title {
	height: 1.2em;
	width: 60%;
}

.n-skeleton--media {
	aspect-ratio: 4 / 3;
	border-radius: 0;
}

@keyframes n-shimmer {
	from {
		background-position: 200% 0;
	}
	to {
		background-position: -200% 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.n-skeleton {
		animation: none;
	}
}

/* ---------- Card ---------- */
.n-card {
	background: var(--n-color-surface);
	border: 1px solid var(--n-color-border);
	border-radius: var(--n-radius-lg);
	box-shadow: var(--n-shadow-xs);
}

.n-card__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--n-space-4);
	padding: var(--n-space-5) var(--n-space-6) 0;
}

.n-card__body {
	padding: var(--n-space-5) var(--n-space-6);
}

.n-card__footer {
	display: flex;
	justify-content: flex-end;
	flex-wrap: wrap;
	gap: var(--n-space-3);
	padding: var(--n-space-4) var(--n-space-6);
	border-top: 1px solid var(--n-color-border);
	background: var(--n-color-bg);
	border-radius: 0 0 var(--n-radius-lg) var(--n-radius-lg);
}

.n-card__description {
	margin-top: var(--n-space-1);
	color: var(--n-color-text-secondary);
	font-size: var(--n-font-size-md);
}

/* ---------- Stat card ---------- */
.n-stat {
	display: flex;
	flex-direction: column;
	gap: var(--n-space-1);
	min-width: 0;
	padding: var(--n-space-4) var(--n-space-5);
	/* Stats are context; they stay flat so property cards carry the visual weight. */
	box-shadow: none;
}

.n-stat__label {
	display: flex;
	align-items: center;
	gap: var(--n-space-2);
	color: var(--n-color-text-secondary);
	font-size: var(--n-font-size-md);
	font-weight: var(--n-font-weight-medium);
}

.n-stat__value {
	margin-top: 2px;
	font-size: var(--n-font-size-stat);
	font-weight: var(--n-font-weight-semibold);
	line-height: 1.1;
	letter-spacing: var(--n-letter-spacing-tight);
	font-variant-numeric: tabular-nums;
	overflow-wrap: anywhere;
}

.n-stat__value--text {
	font-size: var(--n-font-size-xl);
	line-height: 1.25;
}

.n-stat__meta {
	color: var(--n-color-text-muted);
	font-size: var(--n-font-size-sm);
	line-height: 1.4;
	overflow-wrap: anywhere;
}

/* ---------- Badge (always text, color is secondary information) ---------- */
.n-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 2px 8px;
	border: 1px solid var(--n-color-border);
	border-radius: var(--n-radius-full);
	background: var(--n-color-surface-secondary);
	color: var(--n-color-text-secondary);
	font-size: var(--n-font-size-xs);
	font-weight: var(--n-font-weight-semibold);
	line-height: 1.5;
	white-space: nowrap;
}

.n-badge::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
}

.n-badge--plain::before {
	display: none;
}

.n-badge--success {
	background: var(--n-color-success-bg);
	border-color: var(--n-color-success-border);
	color: var(--n-color-success);
}

.n-badge--warning {
	background: var(--n-color-warning-bg);
	border-color: var(--n-color-warning-border);
	color: var(--n-color-warning);
}

.n-badge--error {
	background: var(--n-color-error-bg);
	border-color: var(--n-color-error-border);
	color: var(--n-color-error);
}

.n-badge--info {
	background: var(--n-color-info-bg);
	border-color: var(--n-color-info-border);
	color: var(--n-color-info);
}

.n-badge--brand {
	background: var(--n-color-brand);
	border-color: var(--n-color-brand);
	color: var(--n-color-text-inverse);
}

/* ---------- Forms ---------- */
.n-form {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--n-space-5);
}

.n-form-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--n-space-5);
}

.n-form-grid--3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.n-form-grid__full {
	grid-column: 1 / -1;
}

.n-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.n-label,
.n-fieldset legend {
	color: var(--n-color-text);
	font-size: var(--n-font-size-md);
	font-weight: var(--n-font-weight-medium);
}

.n-label__optional {
	color: var(--n-color-text-muted);
	font-weight: var(--n-font-weight-regular);
}

.n-input,
.n-select,
.n-textarea {
	width: 100%;
	min-height: var(--n-control-height);
	padding: 8px 12px;
	border: 1px solid var(--n-color-border-strong);
	border-radius: var(--n-radius-md);
	background: var(--n-color-surface);
	color: var(--n-color-text);
	font-size: var(--n-font-size-base);
	line-height: 1.4;
	box-shadow: var(--n-shadow-xs);
	transition: border-color var(--n-transition-fast), box-shadow var(--n-transition-fast);
}

.n-textarea {
	min-height: 140px;
	resize: vertical;
}

.n-select {
	appearance: none;
	padding-right: 36px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235b6b80' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
}

.n-input::placeholder,
.n-textarea::placeholder {
	color: var(--n-color-text-muted);
}

.n-input:focus,
.n-select:focus,
.n-textarea:focus {
	outline: none;
	border-color: var(--n-color-focus);
	box-shadow: var(--n-focus-ring);
}

.n-input:disabled,
.n-select:disabled,
.n-textarea:disabled {
	background: var(--n-color-surface-secondary);
	color: var(--n-color-text-muted);
	cursor: not-allowed;
}

.n-input-group {
	display: flex;
}

.n-input-group .n-input {
	border-radius: var(--n-radius-md) 0 0 var(--n-radius-md);
}

.n-input-group__addon {
	display: inline-flex;
	align-items: center;
	padding: 0 12px;
	border: 1px solid var(--n-color-border-strong);
	border-left: 0;
	border-radius: 0 var(--n-radius-md) var(--n-radius-md) 0;
	background: var(--n-color-surface-secondary);
	color: var(--n-color-text-secondary);
	font-size: var(--n-font-size-md);
	white-space: nowrap;
}

.n-field--invalid .n-input,
.n-field--invalid .n-select,
.n-field--invalid .n-textarea,
.n-input[aria-invalid="true"] {
	border-color: var(--n-color-error);
}

.n-field-error {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	color: var(--n-color-error);
	font-size: var(--n-font-size-sm);
	font-weight: var(--n-font-weight-medium);
}

.n-fieldset {
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.n-fieldset legend {
	padding: 0;
	margin-bottom: 6px;
}

.n-choice-list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--n-space-3) var(--n-space-5);
}

.n-check {
	display: inline-flex;
	align-items: center;
	gap: var(--n-space-2);
	font-size: var(--n-font-size-base);
	cursor: pointer;
}

.n-check input {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--n-color-primary);
	cursor: pointer;
}

/* Choice cards (radio as selectable card) */
.n-choice-cards {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--n-space-3);
}

.n-choice-card {
	position: relative;
	display: flex;
	align-items: center;
	gap: var(--n-space-2);
	min-height: var(--n-control-height);
	padding: 0 var(--n-space-4);
	border: 1px solid var(--n-color-border-strong);
	border-radius: var(--n-radius-md);
	background: var(--n-color-surface);
	font-size: var(--n-font-size-md);
	font-weight: var(--n-font-weight-medium);
	cursor: pointer;
	transition: border-color var(--n-transition-fast), background-color var(--n-transition-fast);
}

.n-choice-card input {
	accent-color: var(--n-color-primary);
	margin: 0;
}

.n-choice-card:has(input:checked) {
	border-color: var(--n-color-primary);
	background: var(--n-color-primary-subtle);
}

.n-choice-card:has(input:focus-visible) {
	box-shadow: var(--n-focus-ring);
}

/* Segmented control: tri-state "Ni podano / Da / Ne" */
.n-segmented {
	display: inline-flex;
	flex: none;
	padding: 2px;
	border: 1px solid var(--n-color-border);
	border-radius: var(--n-radius-md);
	background: var(--n-color-surface-secondary);
}

.n-segmented label {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 28px;
	padding: 0 10px;
	border-radius: var(--n-radius-sm);
	color: var(--n-color-text-secondary);
	font-size: var(--n-font-size-sm);
	font-weight: var(--n-font-weight-medium);
	white-space: nowrap;
	cursor: pointer;
	transition: background-color var(--n-transition-fast), color var(--n-transition-fast);
}

.n-segmented label:hover {
	color: var(--n-color-text);
}

.n-segmented input {
	position: absolute;
	opacity: 0;
	inset: 0;
	margin: 0;
	cursor: pointer;
}

.n-segmented label:has(input:checked) {
	background: var(--n-color-surface);
	color: var(--n-color-primary-hover);
	font-weight: var(--n-font-weight-semibold);
	box-shadow: 0 0 0 1px var(--n-color-border-strong), var(--n-shadow-xs);
}

/* "Ni podano" (unknown) is selected in a neutral tone, so a real answer stands out. */
.n-segmented label:has(input[value=""]:checked) {
	color: var(--n-color-text);
}

.n-segmented label:has(input:focus-visible) {
	box-shadow: var(--n-focus-ring);
}

.n-segmented label:has(input:disabled),
.n-choice-card:has(input:disabled),
.n-chip:has(input:disabled),
.n-check:has(input:disabled) {
	opacity: 0.6;
	cursor: not-allowed;
}

/* Selectable chips (checkbox semantics kept; the input stays focusable) */
.n-chips {
	display: flex;
	flex-wrap: wrap;
	gap: var(--n-space-2);
}

.n-chip {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 36px;
	padding: 0 var(--n-space-4);
	border: 1px solid var(--n-color-border-strong);
	border-radius: var(--n-radius-full);
	background: var(--n-color-surface);
	color: var(--n-color-text);
	font-size: var(--n-font-size-md);
	font-weight: var(--n-font-weight-medium);
	cursor: pointer;
	transition: background-color var(--n-transition-fast), border-color var(--n-transition-fast), color var(--n-transition-fast);
}

.n-chip:hover {
	border-color: var(--n-color-primary);
}

.n-chip input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: inherit;
}

.n-chip__check {
	display: none;
}

.n-chip:has(input:checked) {
	border-color: var(--n-color-primary);
	background: var(--n-color-primary-subtle);
	color: var(--n-color-primary-hover);
	font-weight: var(--n-font-weight-semibold);
}

.n-chip:has(input:checked) .n-chip__check {
	display: block;
}

.n-chip:has(input:focus-visible) {
	box-shadow: var(--n-focus-ring);
}

/* Form sections inside one card (wizard): subtle heading + divider, no nested cards */
.n-form-section {
	display: grid;
	gap: var(--n-space-4);
	padding-top: var(--n-space-6);
	border-top: 1px solid var(--n-color-border);
}

.n-form-section:first-of-type {
	padding-top: 0;
	border-top: 0;
}

.n-form-section__title {
	color: var(--n-color-text);
	font-size: var(--n-font-size-base);
	font-weight: var(--n-font-weight-semibold);
	line-height: var(--n-line-height-tight);
}

.n-form-section__head {
	display: grid;
	gap: 2px;
}

.n-form--sections {
	gap: var(--n-space-6);
}

/* Full-width segmented control that lines up with inputs (same outer height). */
.n-segmented--block {
	display: flex;
	width: 100%;
}

.n-segmented--block label {
	flex: 1;
	min-height: calc(var(--n-control-height) - 6px);
	font-size: var(--n-font-size-md);
}

/* Card footer with a status text on the left and actions on the right */
.n-card__footer--split {
	align-items: center;
	justify-content: space-between;
}

.n-card__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--n-space-3);
}

/* Features: two columns of "label + Ni podano / Da / Ne" rows on wide screens */
.n-feature-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: var(--n-space-8);
}

.n-feature-grid .n-feature-row:nth-last-child(-n + 2) {
	border-bottom: 0;
}

.n-feature-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--n-space-4);
	padding: var(--n-space-2) 0;
	font-size: var(--n-font-size-base);
	border-bottom: 1px solid var(--n-color-border);
}

.n-feature-row:last-child {
	border-bottom: 0;
}

/* Toggle (checkbox with role="switch") */
.n-toggle {
	display: inline-flex;
	align-items: center;
	gap: var(--n-space-3);
	cursor: pointer;
	font-size: var(--n-font-size-base);
}

.n-toggle input {
	appearance: none;
	position: relative;
	width: 36px;
	height: 20px;
	margin: 0;
	border-radius: var(--n-radius-full);
	background: var(--n-color-border-strong);
	cursor: pointer;
	transition: background-color var(--n-transition-base);
	flex: none;
}

.n-toggle input::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--n-color-surface);
	box-shadow: var(--n-shadow-sm);
	transition: transform var(--n-transition-base);
}

.n-toggle input:checked {
	background: var(--n-color-primary);
}

.n-toggle input:checked::after {
	transform: translateX(16px);
}

.n-toggle input:focus-visible {
	outline: none;
	box-shadow: var(--n-focus-ring);
}

.n-toggle input:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ---------- Alert ---------- */
.n-alert {
	display: flex;
	gap: var(--n-space-3);
	padding: var(--n-space-4);
	border: 1px solid var(--n-color-info-border);
	border-radius: var(--n-radius-md);
	background: var(--n-color-info-bg);
	color: var(--n-color-text);
	font-size: var(--n-font-size-md);
}

.n-alert__icon {
	color: var(--n-color-info);
	margin-top: 1px;
}

.n-alert__title {
	font-weight: var(--n-font-weight-semibold);
}

.n-alert__body {
	flex: 1;
	min-width: 0;
}

.n-alert__body p + p {
	margin-top: var(--n-space-1);
}

.n-alert--success {
	border-color: var(--n-color-success-border);
	background: var(--n-color-success-bg);
}

.n-alert--success .n-alert__icon {
	color: var(--n-color-success);
}

.n-alert--warning {
	border-color: var(--n-color-warning-border);
	background: var(--n-color-warning-bg);
}

.n-alert--warning .n-alert__icon {
	color: var(--n-color-warning);
}

.n-alert--error {
	border-color: var(--n-color-error-border);
	background: var(--n-color-error-bg);
}

.n-alert--error .n-alert__icon {
	color: var(--n-color-error);
}

/* ---------- Empty state ---------- */
.n-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--n-space-3);
	padding: var(--n-space-12) var(--n-space-6);
	text-align: center;
}

.n-empty__icon {
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	margin-bottom: var(--n-space-2);
	border-radius: var(--n-radius-lg);
	background: var(--n-color-primary-subtle);
	color: var(--n-color-primary);
}

.n-empty__title {
	font-size: var(--n-font-size-lg);
	font-weight: var(--n-font-weight-semibold);
}

.n-empty__text {
	max-width: 420px;
	color: var(--n-color-text-secondary);
}

.n-empty__actions {
	margin-top: var(--n-space-3);
}

/* ---------- Dialog (native <dialog>) ---------- */
.n-dialog {
	width: min(520px, calc(100vw - 2 * var(--n-space-4)));
	max-height: calc(100vh - 2 * var(--n-space-8));
	padding: 0;
	border: 1px solid var(--n-color-border);
	border-radius: var(--n-radius-lg);
	background: var(--n-color-surface);
	color: var(--n-color-text);
	box-shadow: var(--n-shadow-lg);
}

.n-dialog::backdrop {
	background: var(--n-color-overlay);
}

.n-dialog__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--n-space-4);
	padding: var(--n-space-5) var(--n-space-6) 0;
}

.n-dialog__title {
	font-size: var(--n-font-size-lg);
	font-weight: var(--n-font-weight-semibold);
}

.n-dialog__body {
	padding: var(--n-space-4) var(--n-space-6);
	color: var(--n-color-text-secondary);
}

.n-dialog__footer {
	display: flex;
	justify-content: flex-end;
	flex-wrap: wrap;
	gap: var(--n-space-3);
	padding: var(--n-space-4) var(--n-space-6) var(--n-space-5);
}

/* ---------- Dropdown ---------- */
.n-dropdown {
	position: relative;
	display: inline-block;
}

.n-dropdown__menu {
	position: absolute;
	right: 0;
	top: calc(100% + 6px);
	z-index: var(--n-z-dropdown);
	min-width: 200px;
	padding: var(--n-space-1);
	border: 1px solid var(--n-color-border);
	border-radius: var(--n-radius-md);
	background: var(--n-color-surface);
	box-shadow: var(--n-shadow-md);
	list-style: none;
}

.n-dropdown__item {
	display: flex;
	align-items: center;
	gap: var(--n-space-2);
	width: 100%;
	padding: 8px 10px;
	border: 0;
	border-radius: var(--n-radius-sm);
	background: none;
	color: var(--n-color-text);
	font-size: var(--n-font-size-md);
	text-align: left;
	cursor: pointer;
}

.n-dropdown__item:hover,
.n-dropdown__item:focus-visible {
	background: var(--n-color-surface-secondary);
	outline: none;
	text-decoration: none;
	color: var(--n-color-text);
}

.n-dropdown__item[aria-disabled="true"] {
	color: var(--n-color-text-muted);
	cursor: not-allowed;
}

.n-dropdown__item--danger {
	color: var(--n-color-error);
}

/* ---------- Tabs ---------- */
.n-tabs__list {
	display: flex;
	gap: var(--n-space-1);
	border-bottom: 1px solid var(--n-color-border);
	overflow-x: auto;
	overflow-y: hidden;
	scrollbar-width: thin;
	scrollbar-color: var(--n-scrollbar-thumb) transparent;
	-webkit-overflow-scrolling: touch;
}

.n-tabs__list::-webkit-scrollbar {
	height: 4px;
}

.n-tabs__list::-webkit-scrollbar-thumb {
	border-radius: 4px;
	background: var(--n-scrollbar-thumb);
}

.n-tabs__tab {
	flex: none;
}

.n-tabs__tab {
	position: relative;
	padding: var(--n-space-3) var(--n-space-4);
	border: 0;
	background: none;
	color: var(--n-color-text-secondary);
	font-size: var(--n-font-size-md);
	font-weight: var(--n-font-weight-medium);
	white-space: nowrap;
	cursor: pointer;
}

.n-tabs__tab:hover {
	color: var(--n-color-text);
}

.n-tabs__tab[aria-selected="true"] {
	color: var(--n-color-primary);
	font-weight: var(--n-font-weight-semibold);
}

.n-tabs__tab[aria-selected="true"]::after {
	content: "";
	position: absolute;
	left: var(--n-space-3);
	right: var(--n-space-3);
	bottom: 0;
	height: 2px;
	border-radius: 2px;
	background: var(--n-color-primary);
}

.n-tabs__tab:focus-visible {
	outline: none;
	box-shadow: inset var(--n-focus-ring);
	border-radius: var(--n-radius-sm);
}

.n-tabs__panel {
	padding-top: var(--n-space-6);
}

.n-tabs__panel:focus-visible {
	outline: none;
}

/* ---------- Table ---------- */
.n-table-wrap {
	overflow-x: auto;
}

.n-table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--n-font-size-md);
}

.n-table th,
.n-table td {
	padding: 12px var(--n-space-4);
	border-bottom: 1px solid var(--n-color-border);
	text-align: left;
	vertical-align: middle;
}

.n-table thead th {
	background: var(--n-color-bg);
	color: var(--n-color-text-secondary);
	font-size: var(--n-font-size-xs);
	font-weight: var(--n-font-weight-semibold);
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.n-table tbody tr:last-child td,
.n-table tbody tr:last-child th {
	border-bottom: 0;
}

.n-table--kv th {
	width: 40%;
	color: var(--n-color-text-secondary);
	font-weight: var(--n-font-weight-medium);
}

.n-num {
	font-variant-numeric: tabular-nums;
	text-align: right;
}

/* ---------- Toast ---------- */
.n-toasts {
	position: fixed;
	right: var(--n-space-4);
	bottom: var(--n-space-4);
	z-index: var(--n-z-toast);
	display: flex;
	flex-direction: column;
	gap: var(--n-space-2);
	width: min(380px, calc(100vw - 2 * var(--n-space-4)));
	pointer-events: none;
}

.n-toast {
	display: flex;
	align-items: flex-start;
	gap: var(--n-space-3);
	padding: var(--n-space-3) var(--n-space-4);
	border: 1px solid var(--n-color-border);
	border-left: 4px solid var(--n-color-info);
	border-radius: var(--n-radius-md);
	background: var(--n-color-surface);
	box-shadow: var(--n-shadow-md);
	font-size: var(--n-font-size-md);
	pointer-events: auto;
}

.n-toast--success {
	border-left-color: var(--n-color-success);
}

.n-toast--error {
	border-left-color: var(--n-color-error);
}

.n-toast--warning {
	border-left-color: var(--n-color-warning);
}

.n-toast__message {
	flex: 1;
	padding-top: 2px;
}

/* ---------- Stepper (numbered steps joined by a track) ---------- */
.n-stepper {
	display: flex;
	align-items: center;
	gap: var(--n-space-3);
	list-style: none;
}

.n-stepper__item {
	display: flex;
	flex: 1;
	align-items: center;
	gap: var(--n-space-2);
	min-width: 0;
	color: var(--n-color-text-muted);
	font-size: var(--n-font-size-md);
	font-weight: var(--n-font-weight-medium);
}

.n-stepper__item:last-child {
	flex: none;
}

.n-stepper__item:not(:last-child)::after {
	content: "";
	flex: 1;
	min-width: var(--n-space-4);
	height: 2px;
	margin-left: var(--n-space-1);
	border-radius: 2px;
	background: var(--n-color-border);
}

.n-stepper__number {
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	border: 1px solid var(--n-color-border-strong);
	border-radius: 50%;
	background: var(--n-color-surface);
	color: var(--n-color-text-secondary);
	font-size: var(--n-font-size-sm);
	font-weight: var(--n-font-weight-semibold);
	flex: none;
}

.n-stepper__label {
	white-space: nowrap;
}

.n-stepper__item[aria-current="step"] {
	color: var(--n-color-text);
	font-weight: var(--n-font-weight-semibold);
}

.n-stepper__item[aria-current="step"] .n-stepper__number {
	border-color: var(--n-color-primary);
	background: var(--n-color-primary);
	color: var(--n-color-primary-contrast);
	box-shadow: 0 0 0 4px var(--n-color-primary-subtle);
}

.n-stepper__item--done .n-stepper__number {
	border-color: var(--n-color-success-border);
	background: var(--n-color-success-bg);
	color: var(--n-color-success);
}

.n-stepper__item--done::after {
	background: var(--n-color-primary);
}

/* ---------- Property card (whole card clickable via a stretched title link) ---------- */
.n-property-card {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transition: box-shadow var(--n-transition-base), border-color var(--n-transition-base);
}

.n-property-card:hover {
	border-color: var(--n-color-border-strong);
	box-shadow: var(--n-shadow-md);
}

.n-property-card:has(.n-property-card__link:focus-visible) {
	border-color: var(--n-color-focus);
	box-shadow: var(--n-focus-ring);
}

/* Media area has a fixed 4:3 ratio with or without a photo, so cards never shift. */
.n-property-card__media {
	position: relative;
	display: grid;
	place-items: center;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-bottom: 1px solid var(--n-color-border);
	background: var(--n-color-surface-secondary);
	color: var(--n-color-text-muted);
}

.n-cover {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.n-property-card__status {
	position: absolute;
	z-index: 1;
	top: var(--n-space-3);
	left: var(--n-space-3);
	box-shadow: var(--n-shadow-xs);
}

.n-property-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: var(--n-space-1);
	min-width: 0;
	padding: var(--n-space-4) var(--n-space-4) var(--n-space-3);
}

.n-property-card__title {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	font-size: var(--n-font-size-base);
	font-weight: var(--n-font-weight-semibold);
	line-height: var(--n-line-height-tight);
	overflow-wrap: anywhere;
}

.n-property-card__link {
	color: var(--n-color-text);
	text-decoration: none;
}

.n-property-card__link:hover {
	color: var(--n-color-text);
	text-decoration: none;
}

.n-property-card__link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
}

.n-property-card__link:focus-visible {
	outline: none;
}

.n-property-card__meta,
.n-property-card__location {
	color: var(--n-color-text-secondary);
	font-size: var(--n-font-size-sm);
}

.n-property-card__location {
	display: flex;
	align-items: center;
	gap: var(--n-space-1);
	min-width: 0;
}

.n-property-card__location span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.n-property-card__location .n-icon {
	color: var(--n-color-text-muted);
}

.n-property-card__facts {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: var(--n-space-1) var(--n-space-3);
	margin-top: var(--n-space-2);
}

.n-property-card__price {
	font-size: var(--n-font-size-lg);
	font-weight: var(--n-font-weight-semibold);
	font-variant-numeric: tabular-nums;
}

.n-property-card__size {
	color: var(--n-color-text-secondary);
	font-size: var(--n-font-size-md);
}

.n-property-card__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--n-space-3);
	padding: var(--n-space-3) var(--n-space-4);
	border-top: 1px solid var(--n-color-border);
}

.n-property-card__date {
	color: var(--n-color-text-muted);
	font-size: var(--n-font-size-sm);
}

.n-property-card__open {
	display: inline-flex;
	align-items: center;
	gap: var(--n-space-1);
	color: var(--n-color-primary);
	font-size: var(--n-font-size-md);
	font-weight: var(--n-font-weight-semibold);
}

.n-property-card:hover .n-property-card__open {
	color: var(--n-color-primary-hover);
}

/* ---------- Pricing card ---------- */
.n-pricing {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: var(--n-space-5);
	padding: var(--n-space-6);
}

.n-pricing--highlighted {
	border-color: var(--n-color-primary);
	box-shadow: 0 0 0 1px var(--n-color-primary), var(--n-shadow-md);
}

.n-pricing__ribbon {
	position: absolute;
	top: calc(-1 * var(--n-space-3));
	left: var(--n-space-6);
}

.n-pricing__name {
	font-size: var(--n-font-size-lg);
	font-weight: var(--n-font-weight-semibold);
	letter-spacing: 0.02em;
}

.n-pricing__price {
	display: flex;
	align-items: baseline;
	gap: var(--n-space-2);
}

.n-pricing__amount {
	font-size: var(--n-font-size-3xl);
	font-weight: var(--n-font-weight-bold);
	letter-spacing: var(--n-letter-spacing-tight);
}

.n-pricing__period {
	color: var(--n-color-text-secondary);
}

.n-pricing__limits {
	display: grid;
	gap: var(--n-space-1);
	padding-bottom: var(--n-space-5);
	border-bottom: 1px solid var(--n-color-border);
	font-weight: var(--n-font-weight-medium);
}

.n-checklist {
	display: grid;
	gap: var(--n-space-2);
	list-style: none;
	font-size: var(--n-font-size-md);
}

.n-checklist li {
	display: flex;
	align-items: flex-start;
	gap: var(--n-space-2);
}

.n-checklist .n-icon {
	color: var(--n-color-success);
	margin-top: 1px;
}

.n-pricing__cta {
	margin-top: auto;
}

/* ---------- Definition / meta list ---------- */
.n-meta {
	display: flex;
	flex-wrap: wrap;
	gap: var(--n-space-2) var(--n-space-5);
	color: var(--n-color-text-secondary);
	font-size: var(--n-font-size-md);
}

.n-meta__item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

@media (max-width: 720px) {
	.n-choice-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.n-form-grid,
	.n-form-grid--3,
	.n-feature-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.n-feature-grid .n-feature-row:nth-last-child(2) {
		border-bottom: 1px solid var(--n-color-border);
	}

	.n-stepper {
		gap: var(--n-space-2);
	}

	/* Only the current step keeps its visible label; the others stay available to screen readers. */
	.n-stepper__item:not([aria-current="step"]) .n-stepper__label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
	}

	.n-segmented label {
		min-height: 32px;
	}
}

@media (max-width: 400px) {
	.n-segmented--block label {
		padding: var(--n-space-1) 6px;
		font-size: var(--n-font-size-sm);
		line-height: 1.2;
		text-align: center;
		white-space: normal;
	}

	.n-feature-row {
		flex-direction: column;
		align-items: stretch;
		gap: var(--n-space-2);
	}

	.n-feature-row .n-segmented {
		display: flex;
	}

	.n-feature-row .n-segmented label {
		flex: 1;
	}
}

/* Label row with an aside link (e.g. "Pozabljeno geslo?") */
.n-field__label-row {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--n-space-1) var(--n-space-3);
}

/* Password input with show/hide toggle. The input reserves space for the button, so the
   button never covers the text. */
.n-password {
	position: relative;
}

.n-password .n-input {
	padding-right: 48px;
}

.n-password__toggle {
	position: absolute;
	top: 50%;
	right: 4px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	max-height: calc(100% - 4px);
	padding: 0;
	border: 0;
	border-radius: var(--n-radius-sm);
	background: transparent;
	color: var(--n-color-text-secondary);
	transform: translateY(-50%);
	cursor: pointer;
}

.n-password__toggle:hover {
	color: var(--n-color-text);
	background: var(--n-color-surface-secondary);
}

.n-password__toggle:focus-visible {
	outline: none;
	box-shadow: var(--n-focus-ring);
}

.n-password__hide,
.n-password__toggle[aria-pressed="true"] .n-password__show {
	display: none;
}

.n-password__toggle[aria-pressed="true"] .n-password__hide {
	display: inline-block;
}

/* Password strength indicator (guidance only; the server enforces the rules) */
.n-meter {
	display: flex;
	align-items: center;
	gap: var(--n-space-3);
	font-size: var(--n-font-size-sm);
	color: var(--n-color-text-secondary);
}

.n-meter[hidden] {
	display: none;
}

.n-meter__bar {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 4px;
	width: 96px;
	flex: none;
}

.n-meter__bar span {
	height: 4px;
	border-radius: var(--n-radius-full);
	background: var(--n-color-border);
}

.n-meter[data-level="1"] .n-meter__bar span:nth-child(-n+1) { background: var(--n-color-error); }
.n-meter[data-level="2"] .n-meter__bar span:nth-child(-n+2) { background: var(--n-color-warning); }
.n-meter[data-level="3"] .n-meter__bar span { background: var(--n-color-success); }

/* Checkbox whose label wraps over several lines */
.n-check--top {
	align-items: flex-start;
	line-height: 1.5;
}

.n-check--top input {
	margin-top: 2px;
	flex: none;
}

/* Honeypot: off-screen for people, present for bots. */
.n-hp {
	position: absolute !important;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
