

/* Layout Policies */

html, header {
	width: 100%;
}

body {
	margin: 0px;
    width: 100%;
}

* {
	box-sizing: border-box;
}

a {
	cursor: pointer;
}

@media (max-width: 1260px) {
	tg-banner h1 {
    	display: none !important;
  	}
}

@media (max-width: 980px) {
	tg-banner .tg-banner-btns {
    	display: none !important;
  	}
}


/* Layout Controls */

.tg-lr-jr {
	display: grid;
	grid-auto-flow: column;
	justify-content: end;
	gap: 0.5rem;
}

.tg-lr {
	display: grid;
	grid-auto-flow: column;
	gap: 0.5rem;
}

.tg-fitcontent {
	max-width: fit-content;
}

.tg-fill {
	width: 100%;
}

.tg-center {
	margin: auto;
}

.tg-center-text {
	text-align: center;
}

.tg-flex {
	display: flex;
	gap: 1rem;
	align-items: center;
}

.tg-flex-start {
	display: flex;
	gap: 1rem;
	align-items: start;
}

.tg-grid {
	display: grid;
	gap: 1rem;
}

.tg-grid2 {
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(auto-fit,minmax(320px,1fr));
}

/* Look and Feel */

input, select {
	font-family: inherit;
	outline: 0;
	border-radius: 3px;
	padding-inline: 0.7rem;
	padding-block: 0.4rem;
	border-width: 1px;
}

ul {
	padding: 0.5rem;
	margin: 0;
}

button, .tg-active-btn {
	border-radius: 0.3rem;
	font-size: 1.1em;
	width: fit-content;
	padding-inline: 1rem;
	padding-block: 0.3rem;
	cursor: pointer;
}

.tg-bool[tg-value='true']:after {
	content: "Yes";
}

.tg-bool[tg-value='false']:after {
	content: "No";
}

.tg-bool-rev[tg-value='true']:after {
	content: "Yes";
}

.tg-bool-rev[tg-value='false']:after {
	content: "No";
}


/* State Controls */

.tg-uneditable {
	cursor: not-allowed;
}

.tg-loading {
	display:none !important;
}

.tg-hidden {
    display: none !important;
}

/* Buttons */

.tg-link-btn, .tg-push-button {
	display: flex;
	gap: 0.2rem;
	align-items: center;
}

.tg-push-button {
	padding: 0.3rem;
}


/* Footer */

footer {
	margin-top: 1em;
	position: sticky;
	bottom: 0px;
}

/* Panel */

.tg-panel {
	/*
	padding: 2rem;
	padding-top: 1rem;
	*/
	padding: 1rem;
}

.tg-table-header {
    font-weight: 800;
    width: 100%;
    height: 100%;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.tg-help {
	font-style: italic;
	font-size: 0.8em;
	min-height: 2rem;
}


/* Form */

form {
	padding-top: 0.2rem;
	padding-bottom: 0.2rem;
}

.tg-form-buttons {
	padding-top: 0.5rem;
	padding-bottom: 0.5rem;
}
.tg-formitem {
	display: grid;
	gap: 1px;
	padding: 0.5rem;
}

.tg-formitem > * {
	margin-top: 5px;
	margin-bottom: 5px;
}

.tg-formitem:has(>input[type='checkbox']) {
	grid-template-columns: 1rem 1fr;
	gap: 0.7rem;
}

.tg-formitem input[type='checkbox'] {
	margin: 0px;
}

.tg-formerror {
	height: 2em;
}

.tg-push-button a {
	width: 100%;
}

/* Cookie Banner */

tg-cookie-banner {
	position: fixed;
	bottom: 0;
	width: 100%;
}

/* make sure the footer is bigger than the cookie banner so page scrollbars work correctly */
footer:has(tg-cookie-banner) {
  min-height: 6rem;
}

/* Authenticated content */

html.auth .tg-logged-out-only {
	display: none !important;
}

html:not(.auth) .tg-logged-in-only {
	display: none !important;
}

html .tg-rema-only {
	display: none !important;
}
html.auth.r-admin .tg-rema-only, html.auth.r-rema .tg-rema-only {
	display: block !important;
}

html .tg-tiger-only {
	display: none !important;
}
html.auth.r-admin .tg-tiger-only, html.auth.r-tiger .tg-tiger-only {
	display: block !important;
}

html .tg-magpie-only {
	display: none !important;
}
html.auth.r-admin .tg-magpie-only, html.auth.r-magpie .tg-magpie-only {
	display: block !important;
}

html .tg-admin-only {
	display: none !important;
}
html.auth.r-admin .tg-admin-only {
	display: block !important;
}

html:not(.devmode) .tg-devmode-only {
	display: none !important;
}

dialog:not(.tg-need-verify) .tg-verify-only {
	display: none !important;
}

dialog {
	padding: 0px;
	padding-bottom: 0.5rem;
}

dialog .tg-dlg-btns {
	width: 100%;
	display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
	padding-inline: 1rem;
}

dialog h2 {
	padding: 1rem;
	text-align: center;
}

dialog form {
	margin-block: 1rem;
}

dialog > p {
	margin-inline: 1rem;
}

#dlgConfirm[mode='confirm'] .tg-dlg-info-only {
	visibility: hidden !important;
}

#dlgConfirm[mode='info'] .tg-dlg-confirm-only {
	visibility: hidden !important;
}

.tg-invis {
	visibility: hidden !important;
}

.tg-explorer {
	width: 100%;
	display: flex;
	gap: 1rem;
}

.tg-lhs {
	width: 20rem;
}

.tg-chs {
	height: 100%;
	width: 100%;
	min-height: 0px;
	min-width: 0px;
}

.tg-rhs {
	width: 18rem;
}

.tg-lhs .tg-panel, .tg-rhs .tg-panel {
	padding: 0.5rem;
}

.tg-start-row {
	grid-column-start: 1;
}
.tg-span2 {
	grid-column: span 2;
}

.tg-pwd-wrapper {
	display: grid;
	grid-template-columns: 1fr 1rem;
	gap: 1rem;
	align-items: center;
	margin-right: 1rem;

	position: relative;
	/*max-width: fit-content;*/
	width: 100%;
}

.tg-pwd-wrapper .tg-toggle-pwd {
    position: absolute;
    right: 0px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
}

#dlgSettings {
	width: 30rem;
	max-width: 40rem;
}

#dlgRegister {
	width: 30rem;
	max-width: 40rem;
}

#dlgLogin {
	width: 30rem;
	max-width: 40rem;
}
