:root {
	color-scheme: dark;
	font-family: "Segoe UI", sans-serif;
	background: #12151b;
	color: #e8e4d9;
}

html,
body {
	margin: 0;
	min-height: 100%;
}

body>header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.6rem 1rem;
	border-bottom: 1px solid #2c3340;
}

.editor-header-main {
	min-width: 0;
	flex: 1 1 auto;
}

.editor-header-main h1,
.editor-header-main p {
	margin: 0.15rem 0;
}

#editor-restart-now {
	flex: 0 0 auto;
	margin-top: 0.15rem;
	padding: 0.35rem 0.65rem;
	border: 1px solid #7a4a4a;
	border-radius: 0.35rem;
	background: #2a1818;
	color: #f0c8c8;
	font: inherit;
	cursor: pointer;
	white-space: nowrap;
}

#editor-restart-now:hover:not(:disabled) {
	background: #3a2020;
}

#editor-restart-now:disabled {
	opacity: 0.55;
	cursor: default;
}

#editor-restart-now[hidden] {
	display: none !important;
}

body>aside {
	position: absolute;
	left: 0;
	top: 56px;
	width: 250px;
	bottom: 0;
	overflow: auto;
	padding: 0.75rem;
	box-sizing: border-box;
	background: #1a1e26;
	border-right: 1px solid #2c3340;
}

#side-panels {
	position: absolute;
	right: 0;
	top: 56px;
	width: 320px;
	bottom: 0;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	background: #1a1e26;
	border-left: 1px solid #2c3340;
}

.side-panel-tabs {
	display: flex;
	gap: 0;
	border-bottom: 1px solid #2c3340;
	flex: 0 0 auto;
}

.side-panel-tab {
	flex: 1 1 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: #9aa3b2;
	padding: 0.55rem 0.4rem;
	cursor: pointer;
}

.side-panel-tab.active {
	color: #e8e4d9;
	background: #222833;
	box-shadow: inset 0 -2px 0 #6a8cbf;
}

.side-panel-body {
	flex: 1 1 auto;
	min-height: 0;
	overflow: auto;
	padding: 0.75rem;
	box-sizing: border-box;
}

#editor-console {
	margin: 0;
	padding: 0.4rem;
	min-height: 12rem;
	max-height: calc(100% - 2.5rem);
	overflow: auto;
	font: 0.72rem/1.35 ui-monospace, Consolas, monospace;
	white-space: pre-wrap;
	word-break: break-word;
	background: #0e1116;
	border: 1px solid #2c3340;
	color: #c8d0dc;
}

#editor-console .console-warn {
	color: #e0c070;
}

#editor-console .console-error {
	color: #f0a0a0;
}

#editor-console .console-debug {
	color: #7a8494;
}

#console-clear {
	margin-top: 0.5rem;
	width: 100%;
}

.nav,
.palette {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	margin: 0.75rem 0;
}

.dimension-picker {
	margin: 0.75rem 0 0.35rem;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.dimension-picker>label,
.dimension-picker-label {
	font-size: 0.85rem;
	color: #9aa3b2;
}

.dim-combo {
	position: relative;
	display: flex;
	align-items: stretch;
}

.dim-combo-input {
	flex: 1 1 auto;
	width: 0;
	min-width: 0;
	box-sizing: border-box;
}

.dim-combo-toggle {
	flex: 0 0 auto;
	padding: 0 0.45rem;
	border: 1px solid #3a4250;
	border-left: none;
	background: #1a1f28;
	color: #c8d0dc;
	cursor: pointer;
}

.dim-combo-toggle:hover {
	background: #243044;
}

.dim-combo-list {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(100% + 2px);
	z-index: 20;
	margin: 0;
	padding: 0.2rem 0;
	list-style: none;
	max-height: 220px;
	overflow: auto;
	background: #101216;
	border: 1px solid #3a4250;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.dim-combo-option,
.dim-combo-empty {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	padding: 0.35rem 0.55rem;
	cursor: pointer;
}

.dim-combo-option:hover,
.dim-combo-option.selected {
	background: #243044;
}

.dim-combo-option.disabled {
	opacity: 0.55;
}

.dim-combo-option.create {
	color: #b8d4a0;
	border-top: 1px solid #2c3340;
}

.dim-combo-option-hint,
.dim-combo-empty {
	font-size: 0.78rem;
	color: #9aa3b2;
}

.dimension-settings {
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
	margin: 0.5rem 0 0.85rem;
	padding: 0.55rem 0.6rem;
	border: 1px solid #2c3340;
	background: #151922;
}

.dimension-settings label {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	font-size: 0.85rem;
	color: #9aa3b2;
}

.dimension-settings input,
.dimension-settings select {
	width: 100%;
	box-sizing: border-box;
}

.dimension-settings-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
}

#dim-delete {
	border-color: #8a3a3a;
	color: #f0a0a0;
}

button,
input {
	font: inherit;
	background: #101216;
	color: inherit;
	border: 1px solid #3a4250;
	padding: 0.3rem 0.5rem;
}

button {
	cursor: pointer;
}

button:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

#save.save-dirty:not(:disabled) {
	animation: save-pulse 1.1s ease-in-out infinite;
	border-color: #c9a227;
	box-shadow: 0 0 0 1px rgba(201, 162, 39, 0.35);
}

@keyframes save-pulse {

	0%,
	100% {
		opacity: 1;
	}

	50% {
		opacity: 0.55;
	}
}

#unsaved-chunk-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.62);
	z-index: 29;
}

#unsaved-chunk-modal {
	position: fixed;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	z-index: 30;
	width: min(420px, 92vw);
	padding: 1rem 1.1rem;
	background: #161a22;
	border: 1px solid #3a4250;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

#unsaved-chunk-modal header {
	margin: 0 0 0.5rem;
	padding: 0;
	border: 0;
}

#unsaved-chunk-modal h2 {
	margin: 0;
	font-size: 1.1rem;
}

#dimension-settings-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.62);
	z-index: 29;
}

#dimension-settings-modal {
	position: fixed;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	z-index: 30;
	width: min(420px, 92vw);
	padding: 1rem 1.1rem;
	background: #161a22;
	border: 1px solid #3a4250;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

#dimension-settings-modal header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin: 0 0 0.75rem;
	padding: 0;
	border: 0;
}

#dimension-settings-modal h2 {
	margin: 0;
	font-size: 1.1rem;
}

#dimension-settings-modal .dimension-settings {
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
}

.unsaved-chunk-actions {
	display: flex;
	justify-content: flex-end;
	gap: 0.5rem;
	margin-top: 1rem;
}

#apply-status.ok {
	color: #b8d4a0;
}

.error {
	color: #f0a0a0;
}

.hint {
	color: #9aa3b2;
	font-size: 0.85rem;
}

.open-toggle {
	display: flex;
	gap: 0.4rem;
	align-items: center;
}

article {
	margin-bottom: 0.75rem;
}

fieldset {
	border-color: #3a4250;
	margin-top: 1rem;
}

#selection-border {
	position: fixed;
	pointer-events: none;
	box-sizing: border-box;
	border: 2px solid #e23d3d;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55);
	z-index: 4;
}

label {
	display: block;
	margin: 0.4rem 0;
}

#settings-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.62);
	z-index: 19;
}

#settings-modal {
	position: fixed;
	inset: 4vh 4vw;
	z-index: 20;
	display: flex;
	background: #161a22;
	border: 1px solid #3a4250;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

#settings-modal[hidden],
#settings-backdrop[hidden] {
	display: none !important;
}

#settings-main {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

#settings-main header,
#settings-main footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.75rem 1rem;
	border-bottom: 1px solid #2c3340;
}

#settings-main footer {
	border-bottom: 0;
	border-top: 1px solid #2c3340;
}

#settings-form {
	flex: 1;
	overflow: auto;
	padding: 0;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.settings-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	padding: 0.65rem 1rem 0.5rem;
	border-bottom: 1px solid #2c3340;
	background: #12151c;
}

.settings-tab {
	appearance: none;
	border: 1px solid transparent;
	background: transparent;
	color: #a8a295;
	padding: 0.35rem 0.7rem;
	border-radius: 4px;
	cursor: pointer;
	font: inherit;
}

.settings-tab:hover {
	color: #e8e2d4;
	background: #1c222c;
}

.settings-tab.active {
	color: #1a1510;
	background: #d4c48a;
	border-color: #d4c48a;
}

.settings-panels {
	flex: 1;
	overflow: auto;
	padding: 0.75rem 1rem 1.25rem;
}

.settings-category {
	margin-bottom: 0;
}

.settings-category h3 {
	margin: 0 0 0.5rem;
	font-size: 0.95rem;
	color: #d4c48a;
	border-bottom: 1px solid #2c3340;
	padding-bottom: 0.25rem;
}

.setting-row {
	display: grid;
	grid-template-columns: minmax(12rem, 1fr) minmax(8rem, 14rem) 4rem;
	gap: 0.4rem 0.75rem;
	align-items: center;
	padding: 0.45rem 0.5rem;
	margin: 0.2rem 0;
	border-radius: 4px;
}

.setting-row .hint {
	grid-column: 1 / -1;
	margin: 0;
}

.setting-row.dirty {
	background: #4a3d18;
	box-shadow: inset 0 0 0 1px #c4a35a;
}

.setting-value {
	font-variant-numeric: tabular-nums;
	color: #c5c0b4;
}

.seed-price-panel {
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	min-height: 0;
}

.seed-price-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.55rem 0.75rem;
	align-items: center;
}

.seed-price-search {
	flex: 1 1 12rem;
	min-width: 10rem;
	padding: 0.4rem 0.55rem;
	background: #10141b;
	border: 1px solid #3a4250;
	color: #e8e4d9;
	font: inherit;
}

.seed-price-meta {
	flex: 0 0 auto;
}

.seed-price-pager {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	margin-left: auto;
}

.seed-price-pager button {
	appearance: none;
	border: 1px solid #3a4250;
	background: #1c222c;
	color: #e8e4d9;
	padding: 0.3rem 0.55rem;
	cursor: pointer;
	font: inherit;
}

.seed-price-pager button:disabled {
	opacity: 0.4;
	cursor: default;
}

.seed-price-header,
.seed-price-row {
	display: grid;
	grid-template-columns: minmax(10rem, 1.6fr) 6.5rem 5.5rem 5.5rem;
	gap: 0.5rem 0.65rem;
	align-items: center;
}

.seed-price-header {
	padding: 0.25rem 0.4rem;
	color: #a8a295;
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	border-bottom: 1px solid #2c3340;
}

.seed-price-list {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.seed-price-row {
	padding: 0.4rem;
	border-radius: 4px;
}

.seed-price-row.dirty {
	background: #4a3d18;
	box-shadow: inset 0 0 0 1px #c4a35a;
}

.seed-price-name {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	min-width: 0;
}

.seed-price-name strong {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.seed-price-name small {
	color: #8b8790;
	font-size: 0.75rem;
}

.seed-price-seed {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	font-size: 0.75rem;
	color: #a8a295;
}

.seed-price-seed input {
	width: 100%;
	padding: 0.3rem 0.4rem;
	background: #10141b;
	border: 1px solid #3a4250;
	color: #e8e4d9;
	font: inherit;
}

.seed-price-readonly {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	font-size: 0.75rem;
	color: #a8a295;
}

.seed-price-readonly strong {
	font-size: 0.95rem;
	color: #e8e4d9;
	font-variant-numeric: tabular-nums;
}

.seed-price-readonly strong.muted {
	color: #6d6875;
}

.starter-equipment-panel h3 {
	margin: 0.85rem 0 0.4rem;
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #9aa3b2;
}

.starter-equip-list,
.starter-inv-list {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.starter-equip-row {
	display: grid;
	grid-template-columns: 5.5rem 1fr;
	gap: 0.5rem;
	align-items: center;
}

.starter-equip-row.dirty select,
.starter-inv-row.dirty select,
.starter-inv-row.dirty input {
	border-color: #c4a35a;
}

.starter-inv-row {
	display: grid;
	grid-template-columns: 1fr 4.5rem auto;
	gap: 0.4rem;
	align-items: center;
}

.equip-stats-panel {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	min-width: 0;
}

.equip-stats-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: center;
}

.equip-stats-category-label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.85rem;
	color: #c5ccd8;
}

.equip-stats-category {
	min-width: 12rem;
}

.equip-stats-tables {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	overflow: auto;
	max-height: min(62vh, 640px);
}

.equip-stats-table-wrap {
	overflow: auto;
}

.equip-stats-table {
	border-collapse: collapse;
	width: max-content;
	min-width: 100%;
	font-size: 0.8rem;
}

.equip-stats-table th,
.equip-stats-table td {
	border: 1px solid #2c3340;
	padding: 0.35rem 0.45rem;
	vertical-align: middle;
	text-align: center;
}

.equip-stats-table th {
	background: #1a1f28;
	color: #9aa3b2;
	font-weight: 600;
	position: sticky;
	top: 0;
	z-index: 1;
}

.equip-stats-table th:first-child,
.equip-stats-table td.equip-stats-item {
	position: sticky;
	left: 0;
	z-index: 2;
	background: #151922;
	text-align: left;
	min-width: 9rem;
}

.equip-stats-table th:first-child {
	z-index: 3;
}

.equip-stats-item {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	white-space: nowrap;
}

.equip-stats-icon {
	image-rendering: pixelated;
	flex-shrink: 0;
	background: #0e1218;
	border: 1px solid #2c3340;
}

.equip-stats-cell.empty {
	color: #5c6575;
}

.equip-stats-cell-inner {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	align-items: stretch;
}

.equip-stats-stat {
	display: flex;
	align-items: center;
	gap: 0.3rem;
	margin: 0;
}

.equip-stats-stat img {
	flex-shrink: 0;
}

.equip-stats-stat input {
	width: 3.2rem;
	padding: 0.15rem 0.25rem;
}

.equip-stats-stat.dirty input {
	border-color: #c4a35a;
}

#settings-log-wrap {
	width: min(340px, 32vw);
	flex-shrink: 0;
	border-left: 1px solid #2c3340;
	display: flex;
	flex-direction: column;
	background: #1a1e26;
}

#settings-log-wrap h2 {
	margin: 0;
	padding: 0.75rem 1rem;
	border-bottom: 1px solid #2c3340;
	font-size: 1rem;
}

#settings-log {
	flex: 1;
	overflow: auto;
	padding: 0.75rem 1rem;
}

#palette-backdrop,
#tile-config-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.62);
	z-index: 19;
}

#palette-modal,
#tile-config-modal {
	position: fixed;
	z-index: 20;
	display: flex;
	flex-direction: column;
	background: #161a22;
	border: 1px solid #3a4250;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

#palette-modal {
	inset: 8vh 12vw;
}

#tile-config-modal {
	top: 10vh;
	left: 50%;
	transform: translateX(-50%);
	width: min(440px, 92vw);
	max-height: 80vh;
}

#palette-modal[hidden],
#palette-backdrop[hidden],
#tile-config-modal[hidden],
#tile-config-backdrop[hidden],
#tile-tooltip[hidden] {
	display: none !important;
}

#palette-modal>header,
#tile-config-modal>header,
#tile-config-modal>footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.75rem 1rem;
	border-bottom: 1px solid #2c3340;
}

#tile-config-modal>footer {
	border-bottom: 0;
	border-top: 1px solid #2c3340;
}

#palette-panels {
	flex: 1;
	overflow: auto;
	padding: 0.75rem 1rem 1.25rem;
}

.palette-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
	gap: 0.6rem;
}

.palette-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.35rem;
	padding: 0.55rem 0.4rem;
	min-height: 6.5rem;
}

.palette-thumb {
	width: 48px;
	height: 48px;
	display: grid;
	place-items: center;
	background: #0d1016;
	border: 1px solid #2c3340;
	image-rendering: pixelated;
	font-weight: 600;
	color: #9aa3b2;
}

.palette-thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	image-rendering: pixelated;
}

#tile-config-form {
	padding: 0.75rem 1rem 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	flex: 1;
	min-height: 0;
	overflow: auto;
}

.spawner-sells-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	margin-top: 0.55rem;
}

.spawner-sells-list {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.spawner-sells-row {
	display: grid;
	grid-template-columns: 1fr 4.5rem auto;
	gap: 0.4rem;
	align-items: center;
}

.spawner-drops-row {
	display: grid;
	grid-template-columns: 1fr 3.5rem 3.5rem 4.5rem auto;
	gap: 0.4rem;
	align-items: center;
}

.spawner-sells-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.spawner-drops-chance {
	display: flex;
	align-items: center;
	gap: 0.2rem;
}

.spawner-drops-chance input {
	width: 100%;
	min-width: 0;
}

.spawner-equip-list {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.spawner-equip-row {
	display: grid;
	grid-template-columns: 4.5rem 1fr auto auto auto;
	gap: 0.35rem;
	align-items: center;
}

.spawner-equip-slot {
	text-transform: capitalize;
	color: #9aa3b2;
	font-size: 0.85rem;
}

.spawner-equip-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.spawner-equip-dye-swatch {
	display: inline-block;
	width: 0.85rem;
	height: 0.85rem;
	margin-right: 0.35rem;
	border: 1px solid #3a4250;
	vertical-align: -0.1rem;
	border-radius: 2px;
}

#equip-dye-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	z-index: 23;
}

#equip-dye-modal {
	position: fixed;
	z-index: 24;
	top: 18vh;
	left: 50%;
	transform: translateX(-50%);
	width: min(340px, 90vw);
	display: flex;
	flex-direction: column;
	background: #161a22;
	border: 1px solid #3a4250;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

#equip-dye-modal[hidden],
#equip-dye-backdrop[hidden] {
	display: none !important;
}

#equip-dye-modal>header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.75rem 1rem;
	border-bottom: 1px solid #2c3340;
}

.equip-dye-body {
	padding: 0.85rem 1rem 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
}

.equip-dye-preview {
	height: 3rem;
	border: 1px solid #3a4250;
	border-radius: 4px;
	background: #c85078;
}

.equip-dye-channel {
	display: grid;
	grid-template-columns: 1.25rem 1fr 3.5rem;
	gap: 0.4rem;
	align-items: center;
	font-size: 0.85rem;
	color: #9aa3b2;
}

.equip-dye-channel input[type="number"] {
	width: 100%;
}

.equip-dye-actions {
	display: flex;
	justify-content: flex-end;
	gap: 0.4rem;
	margin-top: 0.25rem;
}

.spawner-buys-row {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	margin-top: 0.45rem;
}

#shop-item-search-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	z-index: 21;
}

#shop-item-search-modal {
	position: fixed;
	z-index: 22;
	top: 18vh;
	left: 50%;
	transform: translateX(-50%);
	width: min(420px, 92vw);
	max-height: 70vh;
	display: flex;
	flex-direction: column;
	background: #161a22;
	border: 1px solid #3a4250;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

#shop-item-search-modal[hidden],
#shop-item-search-backdrop[hidden] {
	display: none !important;
}

#shop-item-search-modal>header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.75rem 1rem;
	border-bottom: 1px solid #2c3340;
}

#shop-item-search-modal>.shop-item-search-body {
	padding: 0.75rem 1rem 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	min-height: 0;
	overflow: hidden;
}

#shop-item-search-results {
	overflow: auto;
	max-height: 40vh;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.shop-item-search-row {
	text-align: left;
	padding: 0.4rem 0.5rem;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.1rem;
}

.shop-item-search-row-name {
	font: inherit;
	color: inherit;
}

.shop-item-search-row-key {
	font-size: 0.78rem;
	color: #9aa3b2;
}

.shop-item-search-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	flex-shrink: 0;
}

#shop-item-search-page {
	flex: 1;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

#tile-tooltip {
	position: fixed;
	z-index: 15;
	pointer-events: none;
	max-width: 16rem;
	padding: 0.4rem 0.55rem;
	background: rgba(12, 14, 18, 0.92);
	border: 1px solid #3a4250;
	color: #e8e4d9;
	font-size: 0.8rem;
	white-space: pre-wrap;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

#hover-status {
	position: fixed;
	left: 250px;
	right: 280px;
	bottom: 0;
	z-index: 5;
	margin: 0;
	padding: 0.35rem 0.75rem;
	border-top: 1px solid #2c3340;
	background: #1a1e26;
	color: #c5c9d2;
	font-size: 0.85rem;
	pointer-events: none;
}

#hover-status-text {
	font-variant-numeric: tabular-nums;
}


#quests-backdrop,
#dialogues-backdrop,
#gifts-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.62);
	z-index: 19;
}

#quests-modal,
#dialogues-modal,
#gifts-modal {
	position: fixed;
	inset: 5vh 5vw;
	z-index: 20;
	display: flex;
	flex-direction: column;
	background: #161a22;
	border: 1px solid #3a4250;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

#quests-modal[hidden],
#quests-backdrop[hidden],
#dialogues-modal[hidden],
#dialogues-backdrop[hidden],
#gifts-modal[hidden],
#gifts-backdrop[hidden] {
	display: none !important;
}

#quests-modal>header,
#dialogues-modal>header,
#gifts-modal>header,
#quests-modal>footer,
#dialogues-modal>footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.75rem 1rem;
	border-bottom: 1px solid #2c3340;
}

#quests-modal>footer,
#dialogues-modal>footer {
	border-bottom: 0;
	border-top: 1px solid #2c3340;
	justify-content: flex-end;
}

.gifts-layout {
	flex: 1;
	min-height: 0;
	display: flex;
	overflow: hidden;
}

.gifts-search-pane {
	width: 260px;
	flex-shrink: 0;
	border-right: 1px solid #2c3340;
	padding: 0.65rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	overflow: auto;
	background: #12151c;
}

.gifts-search-label {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	font-size: 0.85rem;
}

.gifts-detail {
	flex: 1;
	min-width: 0;
	overflow: auto;
	padding: 0.85rem 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.gifts-message-label {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.gifts-message-label textarea {
	width: 100%;
	min-height: 6rem;
	resize: vertical;
	font: inherit;
}

.gifts-items-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
}

.gifts-item-list {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.gifts-item-row {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.gifts-item-row span {
	flex: 1;
	min-width: 0;
}

.gifts-item-row input[type="number"] {
	width: 5rem;
}

.gifts-item-search-results {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	max-height: 14rem;
	min-height: 4rem;
	overflow: auto;
	border: 1px solid #2c3340;
	background: #0f1218;
	padding: 0.35rem;
}

.gifts-item-search-results .shop-item-search-row {
	width: 100%;
}

.gifts-preview-wrap {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	margin-top: 0.25rem;
}

.gifts-letter-preview,
.gifts-letter-signature {
	margin: 0;
	padding: 0.75rem;
	background: #0f1218;
	border: 1px solid #2c3340;
	white-space: pre-wrap;
	font-family: Georgia, "Times New Roman", serif;
	font-size: 0.92rem;
	line-height: 1.35;
}

.gifts-letter-signature {
	opacity: 0.9;
}

#gifts-status.error {
	color: #e8a0a0;
}

.content-editor-layout {
	flex: 1;
	min-height: 0;
	display: flex;
	overflow: hidden;
}

.content-editor-list-pane {
	width: 220px;
	flex-shrink: 0;
	border-right: 1px solid #2c3340;
	padding: 0.65rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	overflow: auto;
	background: #12151c;
}

.content-editor-list {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.content-editor-list button {
	text-align: left;
	width: 100%;
}

.content-editor-list button.active {
	border-color: #6b8cae;
	background: #1c2838;
}

.content-editor-detail {
	flex: 1;
	min-width: 0;
	overflow: auto;
	padding: 0.75rem 1rem 1rem;
}

.content-editor-detail label {
	display: block;
	margin: 0.4rem 0;
}

.content-editor-detail input[type="text"],
.content-editor-detail input[type="number"],
.content-editor-detail textarea,
.content-editor-detail select {
	display: block;
	width: 100%;
	margin-top: 0.2rem;
	box-sizing: border-box;
}

.content-editor-section {
	border: 1px solid #2c3340;
	padding: 0.55rem 0.65rem;
	margin: 0.55rem 0;
	background: #12151c;
}

.content-editor-section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	margin-bottom: 0.35rem;
}

.content-editor-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	align-items: center;
	margin: 0.35rem 0;
}

.content-editor-remove,
#dialogues-delete {
	color: #f0e8e8;
	background: #8a3030;
	border-color: #a84848;
}

.content-editor-remove:hover,
#dialogues-delete:hover:not(:disabled) {
	background: #a83838;
	border-color: #c06060;
}

#dialogues-delete:disabled {
	opacity: 0.45;
}

.content-editor-add-step {
	display: block;
	width: 100%;
	margin: 0.35rem 0 0.75rem;
	padding: 0.45rem 0.6rem;
	color: #9eb0c8;
	background: transparent;
	border: 1px dashed #3a4558;
	cursor: pointer;
}

.content-editor-add-step:hover {
	color: #c5d4e8;
	border-color: #5a6a82;
	background: #1a2230;
}

.content-editor-clause {
	border: 1px dashed #3a4250;
	padding: 0.4rem;
	margin: 0.35rem 0;
}

.content-editor-hint {
	color: #8a909c;
	font-size: 0.85rem;
	margin: 0.25rem 0 0.5rem;
}
.dialogue-reward-item-search {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	margin: 0.35rem 0 0.6rem;
}

.dialogue-reward-item-results {
	max-height: 220px;
	overflow: auto;
	border: 1px solid #3a4250;
	border-radius: 4px;
	background: #12151c;
}
