/* ---- app shell: sidebar and settings pane scroll independently on wide screens */

#editor {
	color: #e8ecf8;
	display: flex;
	flex-direction: column;
}

@media (min-width: 992px) {
	body.editor-page {
		height: 100vh;
		display: flex;
		flex-direction: column;
		overflow: hidden;
	}

	body.editor-page > .navbar {
		flex: none;
	}

	body.editor-page .editor-footer {
		display: none;
	}

	#editor {
		flex: 1 1 auto;
		min-height: 0;
		flex-direction: row;
	}

	#sidebar {
		flex: none;
		width: 300px;
		min-height: 0;
	}

	#main-col {
		flex: 1 1 auto;
		min-width: 0;
		min-height: 0;
		overflow-y: auto;
	}
}

#sidebar {
	display: flex;
	flex-direction: column;
	background-color: #101833;
	border-right: 1px solid #25305a;
}

.sb-head {
	flex: none;
	padding: 12px 14px;
	border-bottom: 1px solid #25305a;
}

.guild-icon {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	margin-right: 10px;
	flex: none;
}

.min-w-0 {
	min-width: 0;
}

#dirty-note {
	color: #57E1E6;
}

#dirty-note .dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background-color: #57E1E6;
	margin-right: 4px;
}

.sb-nav {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 8px 0;
	background-color: #0c1330;
}

.sb-nav button {
	display: block;
	width: 100%;
	text-align: left;
	padding: 7px 16px;
	border: 0;
	border-left: 3px solid transparent;
	background: none;
	color: #9aa6c8;
	font-size: 0.9rem;
	cursor: pointer;
}

.sb-nav button:hover {
	color: #e8ecf8;
	background-color: #151d38;
}

.sb-nav button.active {
	color: #57E1E6;
	border-left-color: #57E1E6;
	background-color: #151d38;
}

.sb-nav button .count {
	float: right;
	font-size: 0.75rem;
	color: #9aa6c8;
}

.sb-nav button:disabled {
	opacity: 0.4;
	cursor: default;
}

@media (max-width: 991.98px) {
	.sb-nav {
		display: flex;
		overflow-x: auto;
		padding: 0;
	}

	.sb-nav button {
		width: auto;
		flex: none;
		border-left: 0;
		border-bottom: 2px solid transparent;
		padding: 8px 12px;
	}

	.sb-nav button.active {
		border-bottom-color: #F395F6;
	}

	.sb-nav button .count {
		display: none;
	}
}

.sb-nav button:focus-visible,
#editor .btn:focus-visible,
#editor summary:focus-visible {
	outline: 2px solid #F395F6;
	outline-offset: 1px;
}

#main-col {
	position: relative;
	padding: 14px 18px 40px;
}

#pane {
	max-width: 1100px;
}

#drop-zone.drop {
	outline: 2px dashed #F395F6;
	outline-offset: 4px;
	border-radius: 6px;
}

#editor label,
#editor .h4,
#editor .h5,
#editor .h6,
#editor legend {
	color: #e8ecf8;
}

#editor .muted,
#editor .form-text {
	color: #9aa6c8 !important;
}

#editor code {
	color: #57E1E6;
}

.btn-row {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

/* ---- panels / groups */

.panel,
.group {
	background-color: #151d38;
	border: 1px solid #25305a;
	border-radius: 6px;
	padding: 12px 14px;
	margin-bottom: 12px;
}

.group {
	padding: 0;
}

.group > summary {
	padding: 9px 14px;
	cursor: pointer;
	font-weight: 600;
	color: #e8ecf8;
	display: flex;
	align-items: center;
	gap: 8px;
}

.group > summary::-webkit-details-marker {
	display: none;
}

.group > summary::before {
	content: "\25B8";
	color: #9aa6c8;
	transition: transform 0.15s;
}

.group[open] > summary::before {
	transform: rotate(90deg);
}

.item-tools .btn:disabled {
	opacity: 0.3;
}

.group-body {
	padding: 4px 14px 14px;
}

.group .group {
	background-color: #101833;
}

.pane-title {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 4px;
}

.pane-intro {
	color: #9aa6c8;
	margin-bottom: 14px;
	max-width: 760px;
}

.panel h2.h6,
.panel h3.h6 {
	margin-bottom: 10px;
}

/* ---- form bits */

#editor .form-control,
#editor .custom-select {
	background-color: #0c1330;
	border-color: #25305a;
	color: #e8ecf8;
}

#editor .form-control:focus,
#editor .custom-select:focus {
	border-color: #F395F6;
	box-shadow: 0 0 0 0.15rem rgba(243, 149, 246, 0.25);
}

#editor .form-control::placeholder {
	color: #66729a;
}

#editor .form-control.is-invalid {
	border-color: #e74c3c;
}

#editor select option {
	background-color: #0c1330;
}

.field {
	margin-bottom: 10px;
}

.field > label {
	display: block;
	font-size: 0.85rem;
	margin-bottom: 3px;
}

.field .form-text {
	font-size: 0.78rem;
	margin-top: 2px;
}

.counter {
	float: right;
	font-size: 0.75rem;
	color: #9aa6c8;
}

.counter.over {
	color: #e74c3c;
}

.check {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 0.9rem;
	margin-bottom: 8px;
	cursor: pointer;
}

.check input {
	margin-top: 4px;
}

.check .form-text {
	display: block;
}

.color-row {
	display: flex;
	gap: 6px;
}

.color-row input[type="color"] {
	width: 44px;
	padding: 2px;
	flex: none;
}

.grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 0 14px;
}

.events-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 0 14px;
}

/* chips for multi-pickers */

.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-bottom: 4px;
}

.chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 1px 4px 1px 8px;
	border-radius: 12px;
	background-color: #25305a;
	font-size: 0.82rem;
	max-width: 100%;
}

.chip .swatch {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex: none;
}

.chip span.name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.chip button {
	border: 0;
	background: none;
	color: #9aa6c8;
	padding: 0 4px;
	line-height: 1;
	cursor: pointer;
}

.chip button:hover {
	color: #e74c3c;
}

.chip.missing {
	background-color: #5a2525;
}

.tag {
	font-size: 0.72rem;
	padding: 1px 7px;
	border-radius: 10px;
	background-color: #25305a;
	color: #9aa6c8;
	font-weight: normal;
}

.tag.on {
	background-color: #2f5a25;
	color: #57E1E6;
}

.tag.warn {
	background-color: #4a2a6a;
	color: #F395F6;
}

.item-tools {
	display: flex;
	gap: 4px;
	margin-left: auto;
}

.item-tools .btn {
	padding: 0 6px;
	line-height: 1.4;
}

.empty-state {
	border: 1px dashed #25305a;
	border-radius: 6px;
	padding: 16px 12px;
	text-align: center;
	color: #9aa6c8;
	margin-bottom: 10px;
}

.welcome {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 12px;
	padding: 8px 12px;
	font-size: 0.88rem;
	background-color: #1c2750;
	border: 1px solid #57E1E6;
	border-radius: 6px;
}

.welcome.d-none {
	display: none !important;
}

.issues {
	list-style: none;
	padding: 0;
	margin: 0;
	font-size: 0.85rem;
}

.issues li {
	padding: 4px 0 4px 18px;
	position: relative;
}

.issues li::before {
	content: "!";
	position: absolute;
	left: 4px;
	color: #57E1E6;
	font-weight: bold;
}

.placeholders {
	font-size: 0.78rem;
	color: #9aa6c8;
}

.placeholders code {
	cursor: pointer;
}

/* ---- landing (nothing loaded yet) */

.start {
	max-width: 720px;
}

.start ol {
	padding-left: 1.2rem;
}

.start ol li {
	margin-bottom: 8px;
}

/* ---- embed editor + discord-ish preview */

.embed-editor {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 14px;
}

@media (max-width: 1199.98px) {
	.embed-editor {
		grid-template-columns: minmax(0, 1fr);
	}
}

.preview {
	background-color: #313338;
	border-radius: 6px;
	padding: 12px 14px;
	font-family: "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
	color: #dbdee1;
	font-size: 0.92rem;
	align-self: start;
	overflow-wrap: anywhere;
}

.preview-label {
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #9aa6c8;
	margin-bottom: 4px;
}

.msg {
	display: flex;
	gap: 12px;
}

.msg .avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: linear-gradient(135deg, #552B9D, #57E1E6);
	flex: none;
	object-fit: cover;
}

.msg .body {
	min-width: 0;
	flex: 1;
}

.msg .author {
	font-weight: 600;
	color: #f2f3f5;
}

.msg .badge-app {
	font-size: 0.65rem;
	background-color: #5865f2;
	color: white;
	padding: 1px 4px;
	border-radius: 3px;
	margin-left: 4px;
	vertical-align: middle;
}

.msg .text {
	white-space: pre-wrap;
	margin-top: 2px;
}

.dc-embed {
	margin-top: 6px;
	max-width: 520px;
	background-color: #2b2d31;
	border-left: 4px solid #1e1f22;
	border-radius: 4px;
	padding: 8px 14px 12px 12px;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
}

.dc-embed .e-main {
	min-width: 0;
}

.dc-embed .e-author {
	font-size: 0.82rem;
	font-weight: 600;
	color: #f2f3f5;
	margin-top: 6px;
	display: flex;
	align-items: center;
	gap: 6px;
}

.dc-embed .e-author img,
.dc-embed .e-footer img {
	width: 20px;
	height: 20px;
	border-radius: 50%;
}

.dc-embed .e-title {
	font-weight: 600;
	color: #f2f3f5;
	margin-top: 6px;
}

.dc-embed .e-title a {
	color: #00a8fc;
}

.dc-embed .e-desc {
	font-size: 0.86rem;
	white-space: pre-wrap;
	margin-top: 6px;
}

.dc-embed .e-fields {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 12px;
	margin-top: 8px;
}

.dc-embed .e-field {
	flex: 1 1 100%;
	font-size: 0.86rem;
	min-width: 0;
}

.dc-embed .e-field.inline {
	flex: 1 1 28%;
}

.dc-embed .e-field b {
	display: block;
	color: #f2f3f5;
	white-space: pre-wrap;
}

.dc-embed .e-field div {
	white-space: pre-wrap;
}

.dc-embed .e-thumb {
	width: 80px;
	height: 80px;
	object-fit: cover;
	border-radius: 4px;
	margin: 8px 0 0 12px;
}

.dc-embed .e-image {
	grid-column: 1 / -1;
	max-width: 100%;
	border-radius: 4px;
	margin-top: 12px;
}

.dc-embed .e-footer {
	grid-column: 1 / -1;
	font-size: 0.75rem;
	color: #b5bac1;
	margin-top: 8px;
	display: flex;
	align-items: center;
	gap: 6px;
}

.preview .mention {
	background-color: rgba(88, 101, 242, 0.3);
	color: #c9cdfb;
	border-radius: 3px;
	padding: 0 2px;
}

.preview a {
	color: #00a8fc;
}

.preview code {
	background-color: #1e1f22;
	color: #dbdee1 !important;
	padding: 0 3px;
	border-radius: 3px;
}

.preview .ph {
	color: #F395F6;
}

.dc-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
}

.dc-button {
	padding: 3px 14px;
	border-radius: 4px;
	font-size: 0.85rem;
	font-weight: 500;
	color: white;
	background-color: #4e5058;
	min-height: 32px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.dc-button.primary { background-color: #5865f2; }
.dc-button.success { background-color: #248046; }
.dc-button.danger { background-color: #da373c; }

.dc-select {
	margin-top: 8px;
	max-width: 400px;
	background-color: #1e1f22;
	border-radius: 4px;
	padding: 8px 10px;
	color: #949ba4;
	font-size: 0.88rem;
	display: flex;
	justify-content: space-between;
}

/* ---- status toast (same as the template editor) */

.status {
	position: fixed;
	left: 50%;
	bottom: 18px;
	transform: translateX(-50%);
	max-width: 90%;
	margin: 0;
	padding: 6px 14px;
	border-radius: 6px;
	background-color: rgba(12, 21, 47, 0.95);
	border: 1px solid #57E1E6;
	color: #57E1E6;
	font-size: 0.85rem;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.2s;
	z-index: 50;
}

.status.show {
	opacity: 1;
}

.status.error {
	border-color: #e74c3c;
	color: #ffb3ab;
}
