:root {
	color-scheme: dark;
	--bg: var(--sl-panel, #11151c);
	--ink: #f3ead4;
	--muted: #b9b5a5;
	--gold: #e6bc69;
	--line: #8d876d;
	--panel: var(--sl-panel, #11151c);
}
* {
	box-sizing: border-box;
}
html,
body {
	margin: 0;
	min-height: 100%;
	background: var(--bg);
	color: var(--ink);
}
body {
	display: flex;
	flex-direction: column;
	height: 100dvh;
	font-family: Georgia, "Songti SC", "Noto Serif SC", serif;
}
button,
input,
select {
	font: inherit;
	color: inherit;
}
button,
a,
select {
	cursor: pointer;
}
a {
	color: inherit;
	text-decoration: none;
}
button {
	background: none;
	border: 0;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
	outline: 2px solid var(--gold);
	outline-offset: 3px;
}
.workspace {
	display: grid;
	grid-template-columns: minmax(320px, 36%) minmax(0, 1fr);
	flex: 1 1 auto;
	height: auto;
	min-height: 500px;
}
.catalog {
	min-width: 0;
	display: flex;
	flex-direction: column;
	padding: 22px 28px 24px 36px;
	border-right: 1px solid var(--line);
	min-height: 0;
}
.catalog-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}
.catalog h1,
.detail h2 {
	font-size: clamp(1.7rem, 2.7vw, 2.8rem);
	letter-spacing: 0.09em;
	margin: 0 0 16px;
}
.text-button {
	color: var(--gold);
	padding: 5px 2px;
	font-weight: bold;
	white-space: nowrap;
}
.text-button:hover {
	text-decoration: underline;
}
input,
select {
	background: var(--sl-panel, #11151c);
	border: 1px solid #a19a7e;
	border-radius: 4px;
	min-height: 44px;
	padding: 0 15px;
	width: 100%;
}
input::placeholder {
	color: #b0afa0;
}
.search-box {
	position: relative;
	display: block;
}
.search-box svg {
	position: absolute;
	left: 15px;
	top: 50%;
	transform: translateY(-50%);
	width: 21px;
	height: 21px;
	pointer-events: none;
}
.search-box input {
	padding-left: 47px;
}
.filters {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin-top: 14px;
}
.filters label {
	position: relative;
	min-width: 0;
}
select {
	appearance: none;
	padding-right: 35px;
	text-overflow: ellipsis;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 6 5-6' fill='%23e5d9bf'/%3E%3C/svg%3E");
	background-position: right 12px center;
	background-repeat: no-repeat;
}
.tabs {
	display: flex;
	gap: 24px;
	border-bottom: 1px solid var(--line);
	margin-top: 14px;
}
.tabs button {
	padding: 10px 6px;
	border-bottom: 3px solid transparent;
	font-weight: bold;
}
.tabs button.active {
	border-color: var(--gold);
	color: var(--gold);
}
.list-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	color: var(--muted);
	font-size: 0.8rem;
	min-height: 30px;
}
.quest-list {
	overflow: auto;
	scrollbar-color: #8e8d75 var(--sl-raised, #1a2029);
	scrollbar-width: thin;
	overscroll-behavior: contain;
	scrollbar-gutter: stable;
	min-height: 0;
	flex: 1;
}
.quest-list::-webkit-scrollbar {
	width: 8px;
}
.quest-list::-webkit-scrollbar-track {
	background: var(--sl-raised, #1a2029);
}
.quest-list::-webkit-scrollbar-thumb {
	background: #8e8d75;
	border-radius: 8px;
}
.quest-row {
	display: flex;
	width: 100%;
	align-items: center;
	gap: 15px;
	text-align: left;
	min-height: 52px;
	padding: 10px 12px 10px 4px;
	border-bottom: 1px solid var(--sl-line, #373940);
	letter-spacing: 0.04em;
}
.quest-row:hover {
	background: #ffffff0a;
}
.quest-row.active {
	background: #49482a;
	border: 1px solid #ae9257;
	border-left: 4px solid var(--gold);
	color: #f5d394;
}
.quest-row .book {
	font-size: 1.3rem;
}
.quest-row .title {
	flex: 1;
	min-width: 0;
	overflow-wrap: anywhere;
	font-weight: bold;
}
.quest-row .status {
	font-size: 0.86rem;
	white-space: nowrap;
}
.row-kind,
.row-region,
.column-head {
	display: none;
}
.icon {
	display: inline-flex;
	width: 18px;
	height: 18px;
	vertical-align: middle;
	flex: none;
}
.icon svg,
.book svg {
	width: 100%;
	height: 100%;
}
.book {
	display: inline-flex;
	width: 24px;
	height: 24px;
	flex: none;
}
.text-button .icon,
.map-link .icon {
	margin-right: 7px;
}
.map-link .icon {
	margin-right: 0;
	margin-left: 7px;
}
.back-top {
	align-self: flex-start;
	margin-top: 16px;
}
.detail {
	min-width: 0;
	overflow: auto;
	padding: 24px 30px 32px;
}
.detail-heading {
	display: flex;
	align-items: baseline;
	gap: 24px;
	flex-wrap: wrap;
	border-bottom: 1px solid var(--line);
}
.detail-heading h2 {
	margin-bottom: 12px;
}
.location-label {
	color: var(--muted);
	font-size: 0.95rem;
}
.objectives {
	border-bottom: 1px solid var(--line);
	padding: 14px 0;
}
.objectives-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 5px 12px;
	margin-bottom: 5px;
}
.objectives h3 {
	margin: 0;
	font-size: clamp(1.3rem, 1.7vw, 1.65rem);
}
.objectives ul {
	margin: 0;
	padding: 0;
	list-style: none;
	line-height: 1.45;
}
.objectives li {
	padding: 2px 0;
}
.detail-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 0;
	flex-wrap: wrap;
	font-size: 0.9rem;
}
.objectives-heading .detail-actions {
	padding: 0;
	color: var(--muted);
}
.detail-actions select {
	min-height: 34px;
	width: auto;
	max-width: 100%;
	color: var(--ink);
}
#map-section {
	border: 1px solid var(--gold);
	border-radius: 4px;
	margin-top: 12px;
	overflow: clip;
}
#map-host {
	height: min(54dvh, 620px);
	min-height: 320px;
	background: var(--sl-raised, #1a2029);
}
#map-empty {
	min-height: 260px;
	display: grid;
	place-items: center;
	text-align: center;
	color: var(--muted);
	padding: 30px;
}
#map-empty[hidden] {
	display: none;
}
#map-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 18px;
	flex-wrap: wrap;
}
#map-footer a {
	border: 1px solid var(--gold);
	color: var(--gold);
	padding: 9px 14px;
	border-radius: 3px;
}
.empty {
	color: var(--muted);
	padding: 25px 8px;
	line-height: 1.7;
}
.mobile-back {
	display: none;
}
.workspace.expanded {
	grid-template-columns: 1fr;
}
.workspace.expanded .detail {
	display: none;
}
.workspace.expanded .catalog {
	border-right: 0;
}
.workspace.expanded .column-head {
	display: grid;
	padding: 8px 12px 8px 4px;
	overflow: hidden;
	scrollbar-gutter: stable;
	scrollbar-width: thin;
	color: var(--muted);
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
}
.expanded-progress {
	display: none;
}
.workspace.expanded .column-head::before {
	content: "";
}
.workspace.expanded .column-head,
.workspace.expanded .quest-row {
	display: grid;
	grid-template-columns: 24px minmax(0, 1fr) 14% 22% 14%;
	gap: 12px;
}
.other-places {
	color: var(--muted);
	white-space: nowrap;
}
.workspace.expanded .quest-row.active {
	border-width: 0 0 1px;
	box-shadow: inset 3px 0 var(--gold);
}
.workspace.expanded .row-kind,
.workspace.expanded .row-region {
	display: block;
	min-width: 0;
	overflow-wrap: anywhere;
}
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
#error {
	padding: 20px;
	color: #ffc8b5;
}
@media (max-width: 760px) {
	.workspace {
		display: block;
		height: auto;
		min-height: 0;
	}
	.catalog {
		height: 100%;
		padding: 18px 18px 15px;
		border: 0;
	}
	.detail {
		display: none;
		height: 100%;
		padding: 18px;
	}
	.workspace.show-detail .catalog {
		display: none;
	}
	.workspace.show-detail .detail {
		display: block;
	}
	.mobile-back {
		display: block;
		margin-bottom: 14px;
	}
	.workspace.expanded .column-head span:nth-child(3),
	.workspace.expanded .row-region {
		display: none;
	}
	.workspace.expanded .quest-row,
	.workspace.expanded .column-head {
		grid-template-columns: 20px minmax(0, 1fr) 20% 22%;
		gap: 8px;
	}
	.detail-heading {
		gap: 2px;
	}
	.detail-heading h2 {
		width: 100%;
	}
	#map-host {
		height: 45dvh;
		min-height: 280px;
	}
}
.subtitle {
	display: block;
	color: var(--muted);
	font-size: 0.75rem;
	font-weight: normal;
	margin-top: 3px;
}
.step summary {
	cursor: pointer;
	list-style: none;
	display: flex;
	align-items: baseline;
	gap: 0.7em;
	width: fit-content;
	padding: 2px 4px;
}
.step summary::-webkit-details-marker {
	display: none;
}
.step summary::before {
	content: "";
	display: inline-block;
	width: 0.72em;
	height: 0.72em;
	flex: none;
	border: 1.5px solid #ded4b9;
	border-radius: 50%;
}
.step summary:hover,
.step summary:focus-visible,
.step[open] summary {
	color: var(--gold);
}
.step[open] summary::before {
	box-shadow: inset 0 0 0 3px var(--bg);
	background: var(--gold);
	border-color: var(--gold);
}
.step p {
	color: var(--muted);
	font-size: 0.9rem;
	white-space: pre-line;
	margin: 5px 0 10px 2em;
	line-height: 1.5;
}
@media (min-width: 761px) {
	.workspace.expanded .catalog-head {
		border-bottom: 1px solid var(--line);
		margin-bottom: 18px;
	}
	.workspace.expanded .catalog-tools {
		display: grid;
		grid-template-columns: minmax(0, 2.2fr) minmax(0, 2fr) minmax(0, 1fr);
		align-items: center;
		gap: 16px;
	}
	.workspace.expanded .catalog-tools .filters {
		margin: 0;
	}
	.workspace.expanded .expanded-progress {
		display: block;
		min-width: 0;
	}
	.workspace.expanded .tabs {
		display: none;
	}
	.quest-row .title,
	.step summary,
	.search-box input,
	.filters select,
	.tabs button {
		font-size: clamp(1rem, 1.27vw, 1.25rem);
	}
	.detail {
		display: flex;
		flex-direction: column;
	}
	#map-section {
		flex: 1 0 auto;
		display: flex;
		flex-direction: column;
	}
	#map-section[hidden] {
		display: none;
	}
	#map-host {
		flex: 1 0 310px;
		height: auto;
	}
	#map-footer {
		border-top: 1px solid #806f48;
	}
	#map-footer:empty {
		display: none;
	}
}
.step-count {
	color: var(--gold);
	font-size: 0.9rem;
	white-space: nowrap;
	margin-right: auto;
	font-variant-numeric: tabular-nums;
}
.next-step {
	margin: 6px 0;
	color: var(--gold);
	font-size: 0.9rem;
}
.manual-note {
	margin: 4px 0 8px;
	color: var(--muted);
	font-size: 0.78rem;
}
.objectives .step-list {
	list-style: none;
	padding: 0;
	margin: 0;
}
.objectives li.step-row {
	display: grid;
	grid-template-columns: 36px minmax(0, 1fr);
	align-items: start;
	padding: 0;
	border-bottom: 1px solid #37394041;
}
.step-check {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	min-height: 38px;
	cursor: pointer;
}
.step-check input {
	appearance: auto;
	width: 18px;
	height: 18px;
	min-height: 0;
	margin: 0;
	padding: 0;
	accent-color: var(--gold);
	flex: none;
}
.step-check span {
	min-width: 0;
	overflow-wrap: anywhere;
}
.step-description {
	min-width: 0;
	color: var(--muted);
	font-size: 0.95rem;
}
.step-description summary {
	cursor: pointer;
	color: var(--ink);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	list-style: none;
	min-height: 38px;
	padding: 5px 8px 5px 0;
	font-size: 1.03rem;
}
.step-description summary::-webkit-details-marker {
	display: none;
}
.step-description summary::after {
	content: "";
	width: 7px;
	height: 7px;
	border: solid var(--muted);
	border-width: 0 1px 1px 0;
	transform: rotate(45deg);
	flex: none;
	margin-right: 2px;
}
.step-description[open] summary::after {
	transform: rotate(225deg);
}
.step-description summary:hover,
.step-description[open] summary {
	color: var(--gold);
}
.step-row:has(input:checked) .step-description:not([open]) summary {
	color: var(--muted);
}
.step-description summary:focus-visible {
	outline: 2px solid var(--gold);
	outline-offset: -2px;
}
@media (max-width: 760px) {
	.step-description summary,
	.step-check {
		min-height: 44px;
	}
	.objectives li.step-row {
		grid-template-columns: 44px minmax(0, 1fr);
	}
}
.step-description p {
	white-space: pre-line;
	line-height: 1.5;
	margin: 5px 0 8px;
}
.step-locate {
	color: var(--gold);
	border: 1px solid var(--gold);
	border-radius: 3px;
	padding: 6px 10px;
	margin-bottom: 8px;
}
.step-locate:hover {
	background: #e6bc691c;
}
.share-box {
	margin: 10px 0;
	color: var(--gold);
	font-size: 0.9rem;
}
.share-box summary {
	cursor: pointer;
}
.share-box label {
	display: block;
	margin-top: 8px;
	color: var(--muted);
}
.share-box input {
	display: block;
	margin-top: 5px;
	width: 100%;
	font-size: 0.85rem;
}
.party-banner {
	display: flex;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	margin: 10px 0;
	color: var(--gold);
}
.step-check input:disabled {
	opacity: 1;
	cursor: default;
}
@media (max-width: 1100px) {
	.tabs {
		display: grid;
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 0;
	}
	.tabs button {
		min-width: 0;
		min-height: 44px;
		line-height: 1.15;
		padding: 5px 2px;
		font-size: 0.86rem;
		overflow-wrap: anywhere;
	}
}

/* Keep location and objective actions close to the text they describe. */
.workspace.expanded .compact-location { display: none; }
.quest-description { margin: 12px 0; color: var(--muted); }
.quest-description summary { color: var(--gold); cursor: pointer; width: fit-content; padding: 4px 0; }
.quest-description p { white-space: pre-line; line-height: 1.55; margin: 8px 0; max-width: 75ch; }
.step-content { min-width: 0; padding-bottom: 5px; }
.step-name { display: block; min-height: 38px; padding: 7px 0; overflow-wrap: anywhere; }
.step-locate { display: inline-block; text-align: left; line-height: 1.35; overflow-wrap: anywhere; }
@media (min-width: 761px) and (max-width: 900px) {
  .catalog { padding-inline: 16px; }
  .detail { padding-inline: 20px; }
  .catalog h1 { font-size: 1.6rem; letter-spacing: .03em; }
  .catalog-head { flex-wrap: wrap; }
  .filters { gap: 8px; }
}

.detail-heading { align-items: flex-start; gap: 4px 16px; padding-bottom: 12px; }
.detail-heading h2 { width: 100%; margin: 0; line-height: 1.2; }
.location-label { font-size: 1rem; line-height: 1.45; }
.objectives-heading { gap: 8px 14px; margin-bottom: 10px; }
.step-count { padding: 3px 9px; border: 1px solid var(--sl-line, #373940); border-radius: 4px; }
.objectives li.step-row { padding: 7px 8px; }
.objectives li.is-next { background: #e6bc6910; border-left: 3px solid var(--gold); }
.next-badge { display: block; color: var(--gold); font-size: .76rem; font-weight: bold; margin: 0 0 2px; }
.step-description summary, .step-name { line-height: 1.45; }
.step-locate { min-height: 38px; }
@media (max-width: 760px) { .step-locate { min-height: 44px; } }
