:root {
	--radius-sm: 3px;
	--radius-md: 6px;
	--radius-lg: 7px;
}

[data-theme="dark"] {
	/* Keep radius the same or override if needed */
}

/* Border control for table cells */
tr td.trow1:first-child,
tr td.trow2:first-child,
tr td.trow_shaded:first-child {
	border-left: 0;
}

tr td.trow1:last-child,
tr td.trow2:last-child,
tr td.trow_shaded:last-child {
	border-right: 0;
}

/* Rounded borders for tables */
.tborder {
	border-radius: var(--radius-lg);
}

.tborder tbody tr:last-child > td {
	border-bottom: 0;
}

.tborder tbody tr:last-child > td:first-child {
	border-bottom-left-radius: var(--radius-md);
}

.tborder tbody tr:last-child > td:last-child {
	border-bottom-right-radius: var(--radius-md);
}

/* Header radius styling */
.thead {
	border-top-left-radius: var(--radius-md);
	border-top-right-radius: var(--radius-md);
}

.thead_collapsed {
	border-bottom-left-radius: var(--radius-md);
	border-bottom-right-radius: var(--radius-md);
}

.thead_left {
	border-top-right-radius: 0;
}

.thead_right {
	border-top-left-radius: 0;
}

.tcat_menu {
	border-radius: 0 !important;
}

/* Special collapse case */
.tborder tbody:nth-last-child(2) .tcat_collapse_collapsed {
	border-bottom-left-radius: var(--radius-md) !important;
	border-bottom-right-radius: var(--radius-md) !important;
}

/* Form inputs, alerts, UI components */
input.button,
input.textbox,
input.invalid_field,
input.valid_field,
select,
textarea,
.editor_control_bar,
blockquote,
.codeblock,
fieldset,
.pm_alert,
.red_alert,
.popup_menu,
.postbit_buttons > a,
a.button {
	border-radius: var(--radius-md);
	background-color: var(--card-bg);
    color: var(--color-muted);
    border-color: var(--form-border);
}

/* Post author block */
.post.classic .post_author {
	border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* Popup menu item rounding */
.popup_menu .popup_item_container:first-child .popup_item {
	border-top-left-radius: var(--radius-md);
	border-top-right-radius: var(--radius-md);
}

.popup_menu .popup_item_container:last-child .popup_item {
	border-bottom-left-radius: var(--radius-md);
	border-bottom-right-radius: var(--radius-md);
}

/* Pagination buttons */
.pagination a {
	border-radius: var(--radius-md);
}

/* Poll bars */
.pollbar {
	border-radius: var(--radius-sm);
}

/* Error messages */
div.error {
	border-radius: var(--radius-md);
}
