:root {
	--font-sans: "Segoe UI", Tahoma, Arial, sans-serif;
	--color-bg: #f1eee8;
	--color-surface: #fbf9f5;
	--color-surface-alt: #f3efe8;
	--color-text: #3f3a34;
	--color-text-muted: #6f685f;
	--color-link: #6a6258;
	--color-link-hover: #4f4941;
	--color-border: #d8d1c7;
	--color-primary: #7a7368;
	--color-primary-strong: #625c52;
	--panel-header-bg: var(--color-primary-strong);
	--color-danger: #a5665a;
	--radius-sm: 8px;
	--radius-md: 12px;
	--shadow-sm: 0 2px 8px rgba(35, 31, 26, 0.08);
}

html,
body {
	margin: 0;
	padding: 0;
	background: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-sans);
	font-size: 17px;
	line-height: 1.55;
}

body,
td,
th,
p,
a,
label,
span,
div {
	font-family: var(--font-sans);
	font-size: 1rem;
	text-decoration: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--font-sans);
	color: var(--color-text);
	font-weight: 600;
	margin-top: 0;
	margin-bottom: 0.6rem;
}

p {
	margin: 0 0 0.9rem;
}

ul,
ol {
	margin: 0 0 1rem;
	padding-left: 1.25rem;
}

a,
a:visited {
	color: var(--color-link);
}

a:hover,
a:focus-visible {
	color: var(--color-link-hover);
	text-decoration: underline;
}

a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
	outline: 2px solid var(--color-link);
	outline-offset: 2px;
}

fieldset {
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	margin: 0;
	padding: 14px 16px;
}

label {
	display: inline-block;
	width: 8em;
	text-align: right;
	margin-right: 0.5em;
	font-weight: 600;
	color: var(--color-text-muted);
}

label.px250 {
	vertical-align: top;
	display: inline-block;
	width: 250px;
	text-align: right;
	margin-right: 0.5em;
}

label.px100 {
	vertical-align: top;
	display: inline-block;
	width: 100px;
	text-align: right;
	margin-right: 0.5em;
}

.required {
	color: var(--color-danger);
	font-weight: 700;
}

.alert_parent {
	position: relative;
}

.alert_child {
	text-align: left;
	max-width: 400px;
	position: absolute;
	top: 22px;
	left: 210px;
	color: var(--color-danger);
	font-weight: 700;
	font-size: 0.875rem;
}

select,
input,
textarea {
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	background-color: var(--color-surface);
	color: var(--color-text);
	padding: 8px 10px;
	font-size: 1rem;
	line-height: 1.4;
	box-sizing: border-box;
}

textarea {
	min-height: 120px;
	resize: vertical;
}

option {
	background-color: var(--color-surface);
	color: var(--color-text);
	font-size: 1rem;
}

input.formsubmit,
button,
.app-button {
	display: inline-block;
	min-width: 140px;
	background: var(--color-primary);
	border: 1px solid var(--color-primary);
	border-radius: var(--radius-sm);
	color: #ffffff;
	font-weight: 600;
	padding: 8px 12px;
	cursor: pointer;
	line-height: 1.2;
}

input.formsubmit:hover,
button:hover,
.app-button:hover {
	background: var(--color-primary-strong);
	border-color: var(--color-primary-strong);
	text-decoration: none;
}

input.textelement {
	width: min(100%, 400px);
}

hr {
	border: 0;
	height: 1px;
	background-color: var(--color-border);
}

.footerLink {
	color: var(--color-link);
}

.hideAlert {
	visibility: hidden;
	display: none;
}

.app-shell {
	padding: 12px 16px 24px;
	max-width: 1240px;
	margin: 0 auto;
}

.app-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 10px;
	padding: 8px 10px;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-sm);
}

.app-brand {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
}

.app-brand-logo {
	width: 80px;
	height: auto;
	display: block;
	border-radius: 6px;
}

.app-topbar-meta {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 24px;
}

.app-shell-table {
	width: 100%;
	margin: 0 auto;
	border-collapse: separate;
}

.app-nav-col {
	width: 250px;
	min-width: 220px;
	vertical-align: top;
}

.app-nav {
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	padding: 10px;
	box-shadow: var(--shadow-sm);
}

.app-nav-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.app-nav-item {
	margin: 0;
}

.app-nav-section {
	font-size: 0.72rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-weight: 700;
	color: var(--color-text-muted);
	padding: 3px 6px 0;
	margin-top: 4px;
}

.app-nav-link {
	display: block;
	width: 100%;
	box-sizing: border-box;
	margin: 0;
	padding: 11px 14px;
	background: var(--color-surface-alt);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	color: var(--color-text);
	font-weight: 600;
	text-align: left;
	box-shadow: var(--shadow-sm);
}

.app-nav-link:hover,
.app-nav-link:focus-visible {
	background: var(--color-surface-alt);
	border-color: #bfb6aa;
	color: var(--color-text);
	text-decoration: none;
}

.app-nav-link-secondary {
	background: #f8f5ef;
	color: var(--color-text-muted);
	font-weight: 500;
	box-shadow: none;
}

.app-nav-link-secondary:hover,
.app-nav-link-secondary:focus-visible {
	background: #f1ece4;
	border-color: #c8bfb3;
	color: var(--color-text);
}

.app-action {
	display: inline-block;
	padding: 4px 8px;
	margin: 0 4px;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: 6px;
	color: var(--color-text);
	font-weight: 600;
	text-decoration: none;
	font-size: 0.9rem;
	vertical-align: middle;
}

.app-action:hover,
.app-action:focus-visible {
	background: var(--color-surface-alt);
	border-color: #bfb6aa;
	color: var(--color-text);
}

.app-muted {
	color: var(--color-text-muted);
	font-size: 0.95rem;
}

.form-row {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 10px 0;
}

.form-label {
	min-width: 120px;
	font-weight: 600;
	color: var(--color-text-muted);
}

.search-form .form-row {
	display: flex;
	align-items: center;
	gap: 8px;
}

@media (max-width: 700px) {
  .form-row { flex-direction: column; align-items: stretch; }
  .form-label { text-align: left; width: auto; }
  .app-action { width: 100%; }
}

.app-content {
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-sm);
	padding: 22px;
	min-height: 420px;
}

.app-content > :first-child {
	margin-top: 0;
}

.app-content > :last-child {
	margin-bottom: 0;
}

.app-panel {
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	padding: 16px;
	box-shadow: var(--shadow-sm);
	margin-bottom: 12px;
}

/* Groups panels (moved from groups.cfm) */
.groups-grid { display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: start; }
.panel { background: var(--panel-bg, #fff); border: 1px solid rgba(0,0,0,0.08); border-radius: 6px; overflow: hidden; }
.panel-header { padding: 10px 12px; background: var(--panel-header-bg, #0b66ff); color: #fff; font-weight: 600; }
.panel-body { padding: 12px; }
.pending-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pending-item { display: flex; justify-content: space-between; align-items: center; padding: 8px; border: 1px solid rgba(0,0,0,0.05); border-radius: 6px; background: #fff; }
.pending-actions { display: flex; gap: 8px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 6px; border: 1px solid transparent; cursor: pointer; text-decoration: none; color: inherit; }
.btn-accept { background: #0b66ff; color: #fff; }
.btn-deny { background: #f3f4f6; border-color: #e5e7eb; }
@media (max-width: 720px) {
    .groups-grid { grid-template-columns: 1fr; }
    .panel-header { font-size: 1rem; }
}

/* accessibility helper (if not already present globally) */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Inline SVG icon styling: use current text color and align to text */
.icon { width: 1em; height: 1em; vertical-align: -0.125em; display: inline-block; fill: currentColor; }
.icon svg { width: 100%; height: 100%; display: block; }

.app-lead {
	font-size: 1.125rem;
	font-weight: 600;
	margin: 0 0 12px;
	color: var(--color-text);
}

.app-list {
	margin: 0;
	padding-left: 20px;
	line-height: 1.6;
	color: var(--color-text);
}

.app-footer-shell {
	width: 100%;
	padding: 12px;
	box-sizing: border-box;
}

.app-footer-inner {
	width: 100%;
	margin: 0 auto;
}

.app-footer-grid {
	display: grid;
	grid-template-columns: 1.4fr 1fr;
	gap: 10px;
	align-items: stretch;
	margin-bottom: 10px;
}

.app-alert-card,
.app-online-card {
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-sm);
	padding: 10px 12px;
}

.app-footer-copy {
	text-align: center;
	color: var(--color-text-muted);
	font-size: 0.92rem;
	padding: 6px 4px 2px;
}

.app-alert-bar {
	width: 100%;
	overflow: auto;
	text-align: left;
	box-sizing: border-box;
}

.app-alert-text {
	margin: 0;
	text-align: left;
}

.app-online {
	margin-top: 10px;
	padding: 8px 0;
	color: var(--color-text-muted);
}

.app-online-text {
	margin: 0;
	text-align: center;
}

.app-user-greeting {
	color: var(--color-text-muted);
	font-weight: 600;
}

.app-table-title-row {
	background: var(--color-primary);
	color: #ffffff;
}

.app-table-title-row td,
.app-table-title-row strong {
	color: #ffffff;
}

.app-success-text {
	color: var(--color-text);
	font-weight: 600;
}

.app-error-text {
	color: var(--color-danger);
	font-weight: 600;
}

.app-data-table {
	width: 100%;
	border-collapse: collapse;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	overflow: hidden;
}

.app-data-table th {
	background: var(--color-surface-alt);
	color: var(--color-text);
	font-weight: 600;
	padding: 10px 8px;
	border-bottom: 1px solid var(--color-border);
}

.app-data-table td {
	padding: 9px 8px;
	border-bottom: 1px solid #e6dfd4;
	color: var(--color-text);
}

.app-data-table tbody tr:nth-child(even) {
	background: #f7f3ec;
}

.app-data-table tbody tr:hover {
	background: #eee8df;
}

.app-content table {
	max-width: 100%;
}

.app-content table:not(.app-data-table) td,
.app-content table:not(.app-data-table) th {
	padding: 7px 8px;
	color: var(--color-text);
}

.text-left {
	text-align: left;
}

.text-right {
	text-align: right;
}

.glightbox-help {
	background: var(--color-surface);
	color: var(--color-text);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	padding: 16px;
	max-width: 720px;
	box-sizing: border-box;
	line-height: 1.55;
}

.glightbox-help h2 {
	margin: 0 0 10px;
	font-size: 1.2rem;
	font-weight: 700;
	color: var(--color-text);
	border-bottom: 1px solid var(--color-border);
	padding-bottom: 8px;
}

.glightbox-help p {
	margin: 0 0 10px;
	color: var(--color-text);
}

.glightbox-help p:last-child {
	margin-bottom: 0;
}

.glightbox-help strong {
	color: var(--color-text);
}

.glightbox-help table {
	width: 100%;
	border-collapse: collapse;
	background: transparent;
}

.glightbox-help td,
.glightbox-help th {
	padding: 6px 4px;
	border: 0;
	color: var(--color-text);
}

@media (max-width: 560px) {
	.glightbox-help {
		padding: 12px;
		max-width: 100%;
	}

	.glightbox-help h2 {
		font-size: 1.05rem;
	}
}

/***** special *****/

#divFooter {
	min-height: 40px;
	width: 100%;
	padding: 6px 4px 2px;
	text-align: center;
	color: var(--color-text-muted);
	font-size: 0.9375rem;
}

#divAlertBar {
	text-align: left;
	color: var(--color-text);
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-sm);
	min-height: 0;
	padding: 10px 12px;
}

.fileHeader_dark {
	background: var(--color-primary);
	color: #ffffff;
}


.fileData {
	background: var(--color-surface);
}

.bbsForum {
	background: #ece8e1;
	color: var(--color-text);
}

.bbsForum2 {
	background: var(--color-primary);
	color: #ffffff;
}

.bbsTopic {
	background: #e7e1d8;
	color: var(--color-text);
}

table {
	color: var(--color-text);
}

th,
td {
	color: var(--color-text);
}

@media (max-width: 900px) {
	body,
	td,
	th,
	p,
	a,
	label,
	span,
	div {
		font-size: 1rem;
	}

	.app-shell-table {
		display: block;
	}

	.app-shell-table tbody,
	.app-shell-table tr,
	.app-shell-table td {
		display: block;
		width: 100% !important;
		box-sizing: border-box;
	}

	.app-nav-col {
		margin-bottom: 10px;
	}

	.app-topbar {
		padding: 8px;
	}

	.app-brand-logo {
		width: 72px;
	}

	.app-footer-grid {
		grid-template-columns: 1fr;
	}

	.app-nav-list {
		flex-direction: row;
		flex-wrap: wrap;
		gap: 6px;
	}

	.app-nav-section {
		flex: 1 1 100%;
		padding-top: 6px;
	}

	.app-nav-item {
		flex: 1 1 180px;
	}

	.app-content {
		min-height: 0;
	}

	.app-nav-link {
		width: 100%;
		margin: 0;
		text-align: center;
	}
}

@media (max-width: 560px) {
	body,
	td,
	th,
	p,
	a,
	label,
	span,
	div {
		font-size: 0.95rem;
	}

	.app-shell {
		padding: 8px 10px 16px;
	}

	.app-topbar {
		padding: 6px 8px;
		gap: 8px;
	}

	.app-brand-logo {
		width: 64px;
	}

	.app-topbar-meta {
		font-size: 0.92rem;
	}

	.app-content {
		padding: 14px;
	}

	.app-panel {
		padding: 12px;
	}

	.app-nav-list {
		gap: 4px;
	}

	.app-nav-link {
		width: 100%;
		margin: 2px 0;
		padding: 8px 10px;
		font-size: 0.92rem;
	}

	.form-row {
		gap: 8px;
		margin: 8px 0;
	}

	input,
	select,
	textarea,
	button,
	.app-button,
	.app-action,
	input.formsubmit {
		font-size: 0.95rem;
		min-height: 36px;
	}

	.app-data-table th,
	.app-data-table td {
		padding: 7px 6px;
	}

	.app-alert-card,
	.app-online-card {
		padding: 8px 10px;
	}
}

.post-container { display: block; }
.post-header {
	display: flex;
	flex-direction: column;
	gap: 6px;
	border-bottom: 1px solid var(--color-border);
	padding-bottom: 8px;
	margin-bottom: 12px;
}
.post-meta {
	color: var(--color-text-muted);
	font-size: 0.95rem;
}
.post-body {
	font-size: 1rem;
	line-height: 1.6;
	color: var(--color-text);
	word-wrap: break-word;
}
.post-actions {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
	margin-top: 12px;
}
.post-actions a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 6px; color: inherit; }
.post-actions a:hover { background: #f7f6f4; }
.comments-panel { margin-top: 12px; border-top: 1px solid var(--color-border); padding-top: 12px; }
/* make the comments container scroll rather than the table itself */
#divComments { max-height: 48vh; overflow: auto; }
#tblComments { width: 100%; border-collapse: collapse; }
.comment-item {
	display: flex;
	gap: 12px;
	padding: 10px 12px;
	margin-bottom: 8px;
	align-items: flex-start;
	border-bottom: 0; /* remove hard divider in favor of card-like accent */
	border-left: 3px solid rgba(0,0,0,0.04);
	background: linear-gradient(90deg, rgba(0,0,0,0.01), transparent);
	border-radius: 6px;
	transition: background-color 120ms ease, box-shadow 120ms ease;
}
.comment-item:hover { background: linear-gradient(90deg, rgba(0,0,0,0.02), transparent); box-shadow: 0 2px 8px rgba(35,31,26,0.03); }
.comment-avatar img { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; display: block; }
.comment-avatar { flex: 0 0 50px; margin-left: -6px; /* tuck avatar closer to the accent */ }
.comment-body { flex: 1; min-width: 0; padding-left: 6px; }
.comment-meta { color: var(--color-text-muted); font-size: 0.92rem; margin-bottom: 6px; }
.comment-text { white-space: pre-wrap; line-height: 1.5; }
.comment-actions a { margin-left: 8px; }

@media (max-width: 720px) {
	.post-container { padding: 12px; margin: 10px; }
	.comment-avatar img { width: 40px; height: 40px; }
	#divComments, #tblComments { max-height: 60vh; }
}

