/* Staff tools on the map (#693): the Advanced menu "Admin" card (staff switch,
   public/modules/staffSpotTools.js; dev data toggles, public/modules/devDataControls.js)
   and the staff-only "Posted by" section in the spot details panel. Kept out of
   style.css, which is frozen for new features (docs/reference/ui-architecture.md).
   Only shared tokens from style.css are used, so both themes follow. */

/* Role chip beside "Advanced" (#858), shown while the menu holds role-only options.
   Matches the outline Badge in ui/admin/AccountPage.jsx and .staff-badge below. */
.console-advanced-role-chip {
	margin-left: 8px;
	padding: 1px 8px;
	border: 1px solid var(--details-divider-color);
	border-radius: 999px;
	font-family: var(--headerfont);
	font-size: 11px;
	font-weight: 600;
	line-height: 1.4;
	white-space: nowrap;
	color: var(--muted-text-color);
}

/* Sets no display today; kept so a later display value can't un-hide the chip. */
.console-advanced-role-chip[hidden] {
	display: none;
}

/* Admin card, titled like the Theme Mode section. */
.advanced-admin-section .advanced-section-title {
	font-size: 12px;
	font-weight: 600;
	color: var(--page-text-color);
}

.advanced-admin-section .advanced-section-header {
	min-height: 20px;
}

/* .advanced-section and .admin-toggles set display, which beats the browser's
   [hidden] rule, so each needs an explicit override. */
.advanced-admin-section[hidden],
.admin-toggles[hidden] {
	display: none !important;
}

.admin-toggles {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 2px 0 0;
}

/* "Posted by" section. Label and value reuse the spec-sheet .spec-k / .spec-v
   styles from style.css; only the extras are styled here. */
#details-panel .staff-posted-by {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 7px;
	padding: 6px 0 8px;
	border-bottom: 1px solid var(--details-divider-color);
	overflow-wrap: anywhere;
}

#details-panel .staff-posted-by .spec {
	width: 100%;
}

#details-panel .staff-posted-by-name {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 6px;
}

#details-panel .staff-badge {
	display: inline-block;
	padding: 1px 6px;
	border: 1px solid var(--details-divider-color);
	border-radius: 999px;
	font-family: var(--headerfont);
	font-size: 10px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--details-subtle-text-color);
}

#details-panel .staff-posted-by-sub {
	display: block;
	margin-top: 2px;
	font-size: 12px;
	line-height: 1.25;
	color: var(--details-subtle-text-color);
}

/* Quieter than the filled "Add details" bubble: outlined, text-coloured. */
#details-panel .staff-posted-by-button {
	display: inline-flex;
	align-items: center;
	padding: 4px 10px;
	border: 1px solid var(--details-divider-color);
	border-radius: 999px;
	background: transparent;
	font-family: var(--headerfont);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--purple);
	text-decoration: none;
}

#details-panel .staff-posted-by-button:hover,
#details-panel .staff-posted-by-button:focus-visible {
	background: var(--calendar-indicator-bg);
	border-color: var(--purple);
}

/* Staff "Remove photo" controls (#951): sit inside the photo link's cell, right under the
   "View image or video" row, with a small Staff chip in place of a header. */
#details-panel .staff-photo-tools {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	padding: 2px 4px 6px;
}

#details-panel .staff-photo-controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

/* Same look as .addition-byline-staff in communityAdditions.css. */
#details-panel .staff-photo-chip {
	padding: 0 6px;
	border: 1px solid var(--details-divider-color);
	border-radius: 999px;
	font-family: var(--headerfont);
	font-size: 10px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--details-subtle-text-color);
}

#details-panel .staff-photo-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

#details-panel .staff-photo-tools .staff-posted-by-sub:empty {
	display: none;
}

/* "Delete permanently" box in the Remove photo question (#996). */
#details-panel .staff-photo-delete {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	flex-basis: 100%;
	font-size: 0.85em;
}

/* The photo link and its staff controls are one group: the group's closing line goes below the
   controls, not between the two (and not at all at the end of the grid, as for the row alone). */
#details-panel .spec:has(> .staff-photo-tools) > .media-row {
	border-bottom: 0;
}

#details-panel .spec-grid > .spec:not(:last-child):has(> .staff-photo-tools) {
	border-bottom: 1px solid var(--details-divider-color);
}

/* Staff Hide and Unhide on Community additions entries (#1011): a small outlined button after
   the entry's byline. A hidden entry, which only staff see, is greyed out with a Hidden chip. */
#details-panel .staff-addition-tools {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 6px;
	margin-left: 6px;
	vertical-align: middle;
}

#details-panel .staff-addition-tools .staff-posted-by-button {
	padding: 1px 8px;
	font-size: 11px;
}

/* Hide steps aside while its reasons are open; the button's display rule would override [hidden]. */
#details-panel .staff-addition-toggle[hidden] {
	display: none;
}

#details-panel .staff-addition-status {
	font-size: 11px;
	color: var(--details-subtle-text-color);
}

/* The reasons Hide opens on their own line under the entry, and who hid an entry, when and why
   (#1083). */
#details-panel .staff-addition-reasons {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 6px;
	margin-top: 4px;
}

#details-panel .staff-addition-reason-label {
	flex-basis: 100%;
	font-size: 11px;
	color: var(--details-subtle-text-color);
}

#details-panel .staff-addition-reasons .staff-posted-by-button {
	padding: 1px 8px;
	font-size: 11px;
}

#details-panel .staff-addition-reasons .staff-addition-cancel {
	border-color: transparent;
	background: none;
	color: var(--details-subtle-text-color);
}

#details-panel .staff-addition-hidden-info {
	font-size: 11px;
	color: var(--details-subtle-text-color);
}

#details-panel .staff-addition-status:empty {
	display: none;
}

/* The note under a hidden entry that a promoted spot's event still shows (#1064). It stays at
   full strength while the entry beside it is greyed. */
#details-panel .staff-addition-event-note {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 8px;
	margin-top: 6px;
	padding: 6px 8px;
	border: 1px dashed var(--details-divider-color);
	border-radius: 6px;
	font-size: 12px;
}

/* A link entry is a one-line flex row; let it wrap so the note sits under the link, not beside it. */
#details-panel .community-addition-item--link:has(> .staff-addition-event-note) {
	flex-wrap: wrap;
}

#details-panel .community-addition-item--link > .staff-addition-event-note {
	flex-basis: 100%;
}

#details-panel .staff-addition-event-note .staff-posted-by-button {
	padding: 1px 8px;
	font-size: 11px;
}

#details-panel .community-addition-item--hidden > :not(.staff-addition-tools):not(.staff-addition-event-note) {
	opacity: 0.5;
}

/* Staff "Promote to event" and "Undo promotion" on a circle-bot spot (#1055,
   public/modules/staffPromotionTools.js): placed like "Posted by", with the Staff chip of the
   photo controls. */
#details-panel .staff-promotion-tools {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	padding: 6px 0 8px;
	border-bottom: 1px solid var(--details-divider-color);
	overflow-wrap: anywhere;
}

#details-panel .staff-promotion-tools .staff-posted-by-sub:empty,
#details-panel .staff-promotion-body:empty {
	display: none;
}

#details-panel .staff-promotion-body {
	display: flex;
	flex-direction: column;
	gap: 6px;
	width: 100%;
}

#details-panel .staff-promotion-summary {
	margin: 0;
	font-size: 13px;
}

#details-panel .staff-promotion-field {
	display: flex;
	flex-direction: column;
	gap: 2px;
	width: 100%;
	font-size: 12px;
	color: var(--details-subtle-text-color);
}

#details-panel .staff-promotion-field input {
	box-sizing: border-box;
	width: 100%;
	padding: 5px 8px;
	border: 1px solid var(--details-divider-color);
	border-radius: 6px;
	background: transparent;
	font-size: 14px;
	color: var(--page-text-color);
}

#details-panel .staff-promotion-preview {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 4px 10px;
	margin: 0;
	width: 100%;
}

#details-panel .staff-promotion-preview dd {
	margin: 0;
	white-space: pre-line;
}

#details-panel .staff-promotion-links {
	margin: 0;
	padding-left: 16px;
}
