/*
 * Plinth — top bar panels (Flows & states → Top bar): ⌘K command palette,
 * "New ▾" menu, notifications, account menu, keyboard shortcuts.
 * Colours are --pl-* tokens only. Panels live at the end of <body>, outside
 * #wpadminbar, so core's toolbar resets don't reach them.
 */

/* ===== topbar: triggers ===== */
body.plinth #wpadminbar li.pl-open > .ab-item,
body.plinth #wpadminbar #wp-admin-bar-new-content.pl-open > .ab-item {
	background: var(--pl-surface-3);
	color: var(--pl-text);
}
body.plinth #wpadminbar #wp-admin-bar-command-palette > .ab-item {
	cursor: text;
}

/* ===== topbar: popover shell ===== */
body.plinth .pl-tb-pop {
	position: fixed;
	z-index: 100000;
	box-sizing: border-box;
	background: var(--pl-surface);
	border: 1px solid var(--pl-border-strong);
	border-radius: 12px;
	box-shadow: 0 12px 32px var(--pl-shadow-color);
	overflow: hidden;
	color: var(--pl-text);
	font-family: var(--pl-font);
	font-size: 13px;
	line-height: 1.45;
	text-align: left;
}
body.plinth .pl-tb-pop[hidden] {
	display: none;
}
body.plinth .pl-tb-pop:focus {
	outline: none;
}
body.plinth .pl-tb-pop *,
body.plinth .pl-cmdk * {
	box-sizing: border-box;
}
body.plinth .pl-tb-pop :is(a, button):focus,
body.plinth .pl-cmdk :is(a, button):focus {
	box-shadow: none;
	outline: none;
}
body.plinth .pl-tb-pop :is(a, button):focus-visible,
body.plinth .pl-cmdk button:focus-visible {
	outline: 2px solid var(--pl-accent);
	outline-offset: -2px;
}
body.plinth .pl-tb-new { width: 280px; }
body.plinth .pl-tb-notes { width: 380px; }
body.plinth .pl-tb-acct { width: 300px; }

/* Menu rows: [tile] label / description ……… key */
body.plinth .pl-tb-list {
	padding: 6px;
}
body.plinth .pl-tb-list--foot {
	border-top: 1px solid var(--pl-border);
}
body.plinth .pl-tb-item {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 40px;
	padding: 6px 12px;
	border-radius: 8px;
	color: var(--pl-text);
	text-decoration: none;
}
body.plinth .pl-tb-item:hover,
body.plinth .pl-tb-item:focus {
	background: color-mix(in srgb, var(--pl-text) 4%, transparent);
	color: var(--pl-text);
}
body.plinth .pl-tb-tile {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 7px;
	background: var(--pl-surface-3);
	color: var(--pl-text-2);
}
body.plinth .pl-tb-tile .pl-ico {
	width: 15px;
	height: 15px;
}
body.plinth .pl-tb-text {
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
}
body.plinth .pl-tb-label {
	font-size: 13px;
	font-weight: 500;
}
body.plinth .pl-tb-desc {
	overflow: hidden;
	color: var(--pl-text-3);
	font-size: 12px;
	text-overflow: ellipsis;
	white-space: nowrap;
}
body.plinth .pl-tb-key {
	margin-left: auto;
	color: var(--pl-text-3);
	font-size: 11.5px;
	white-space: nowrap;
}
body.plinth .pl-tb-sep {
	height: 1px;
	margin: 6px 4px;
	background: var(--pl-border);
}
body.plinth .pl-tb-foot {
	padding: 10px 14px;
	border-top: 1px solid var(--pl-border);
	color: var(--pl-text-3);
	font-size: 12px;
}
body.plinth .pl-tb-foot strong {
	color: var(--pl-text-2);
}

/* Text links and chips. */
body.plinth .pl-tb-link {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	padding: 0;
	border: 0;
	background: none;
	color: color-mix(in srgb, var(--pl-accent) 55%, var(--pl-text));
	font-size: 12.5px;
	font-weight: 500;
	text-decoration: none;
	cursor: pointer;
}
body.plinth .pl-tb-link:hover {
	color: color-mix(in srgb, var(--pl-accent) 55%, var(--pl-text));
	text-decoration: underline;
}
body.plinth .pl-tb-link:disabled {
	color: var(--pl-text-3);
	text-decoration: none;
	cursor: default;
}
body.plinth .pl-tb-link .pl-ico {
	width: 14px;
	height: 14px;
}
body.plinth .pl-tb-chip {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	height: 22px;
	padding: 0 8px;
	border: 1px solid var(--pl-border);
	border-radius: 6px;
	background: var(--pl-surface-2);
	color: var(--pl-text-2);
	font-size: 11.5px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	cursor: pointer;
}
body.plinth .pl-tb-chip.is-on {
	border-color: transparent;
	background: color-mix(in srgb, var(--pl-accent) 16%, transparent);
	color: color-mix(in srgb, var(--pl-accent) 55%, var(--pl-text));
}
body.plinth .pl-tb-chip.is-static {
	cursor: default;
}
body.plinth .pl-tb-chip .pl-ico {
	width: 12px;
	height: 12px;
}

/* ===== topbar: notifications ===== */
body.plinth .pl-tb-notes__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 14px 10px;
}
body.plinth .pl-tb-notes__title {
	font-size: 14px;
	font-weight: 600;
}
body.plinth .pl-tb-chips {
	display: flex;
	gap: 4px;
	padding: 0 10px 10px;
}
body.plinth .pl-tb-notes__list {
	max-height: min(460px, calc(100vh - 200px));
	overflow-y: auto;
}
body.plinth .pl-tb-note {
	position: relative;
	display: flex;
	gap: 12px;
	padding: 12px 14px;
	border-top: 1px solid var(--pl-border);
	color: var(--pl-text);
	text-decoration: none;
}
body.plinth .pl-tb-note:hover,
body.plinth .pl-tb-note:focus {
	background: color-mix(in srgb, var(--pl-text) 4%, transparent);
	color: var(--pl-text);
}
body.plinth .pl-tb-note__ico {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 9px;
	background: var(--pl-surface-3);
	color: var(--pl-text-2);
}
body.plinth .pl-tb-note__ico .pl-ico {
	width: 15px;
	height: 15px;
}
body.plinth .pl-tb-note.tone-accent .pl-tb-note__ico {
	background: color-mix(in srgb, var(--pl-accent) 16%, transparent);
	color: color-mix(in srgb, var(--pl-accent) 55%, var(--pl-text));
}
body.plinth .pl-tb-note.tone-warn .pl-tb-note__ico {
	background: color-mix(in srgb, var(--pl-warn) 14%, transparent);
	color: var(--pl-warn);
}
body.plinth .pl-tb-note.tone-crit .pl-tb-note__ico {
	background: color-mix(in srgb, var(--pl-crit) 14%, transparent);
	color: var(--pl-crit);
}
body.plinth .pl-tb-note__body {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	gap: 3px;
	min-width: 0;
}
body.plinth .pl-tb-note.is-unread .pl-tb-note__body {
	padding-right: 14px;
}
body.plinth .pl-tb-note__title {
	font-size: 13px;
	font-weight: 500;
	line-height: 1.35;
}
body.plinth .pl-tb-note.is-unread .pl-tb-note__title {
	font-weight: 600;
}
body.plinth .pl-tb-note__meta {
	overflow: hidden;
	color: var(--pl-text-3);
	font-size: 12px;
	text-overflow: ellipsis;
	white-space: nowrap;
}
body.plinth .pl-tb-note__act {
	margin-top: 6px;
}
body.plinth .pl-tb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 26px;
	padding: 0 10px;
	border: 1px solid var(--pl-border-strong);
	border-radius: 7px;
	background: var(--pl-surface-2);
	color: var(--pl-text);
	font-size: 12.5px;
	font-weight: 500;
	white-space: nowrap;
}
body.plinth .pl-tb-note:hover .pl-tb-btn {
	background: var(--pl-surface-3);
}
body.plinth .pl-tb-note__dot {
	position: absolute;
	top: 18px;
	right: 14px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--pl-accent);
}
body.plinth .pl-tb-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 28px 14px;
	border-top: 1px solid var(--pl-border);
	color: var(--pl-text-3);
	font-size: 12.5px;
}
body.plinth .pl-tb-empty .pl-ico {
	color: var(--pl-success);
}
body.plinth .pl-tb-notes__foot {
	display: flex;
	justify-content: center;
	padding: 10px;
	border-top: 1px solid var(--pl-border);
}

/* ===== topbar: account ===== */
body.plinth .pl-tb-acct__head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 16px 14px;
	border-bottom: 1px solid var(--pl-border);
}
body.plinth .pl-tb-acct__av {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--pl-me-bg);
	color: var(--pl-me-fg);
	font-size: 15px;
	font-weight: 700;
}
body.plinth .pl-tb-acct__who {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}
body.plinth .pl-tb-acct__name {
	font-size: 14px;
	font-weight: 600;
}
body.plinth .pl-tb-acct__email {
	overflow: hidden;
	color: var(--pl-text-3);
	font-size: 12px;
	text-overflow: ellipsis;
	white-space: nowrap;
}
body.plinth .pl-tb-acct__role {
	margin-top: 4px;
}
body.plinth .pl-tb-heading {
	padding: 4px 16px 0;
	color: var(--pl-text-3);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
}
body.plinth .pl-tb-seg {
	display: flex;
	gap: 2px;
	margin: 4px 12px 8px;
	padding: 3px;
	border: 1px solid var(--pl-border);
	border-radius: 8px;
	background: var(--pl-surface-2);
}
body.plinth .pl-tb-seg button {
	display: flex;
	flex: 1;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 28px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	box-shadow: none;
	color: var(--pl-text-2);
	font-family: inherit;
	font-size: 12.5px;
	font-weight: 500;
	cursor: pointer;
}
body.plinth .pl-tb-seg button:hover {
	color: var(--pl-text);
}
body.plinth .pl-tb-seg button.is-on {
	background: color-mix(in srgb, var(--pl-surface-3) 60%, var(--pl-border-strong));
	box-shadow: inset 0 1px 0 color-mix(in srgb, var(--pl-text) 5%, transparent);
	color: var(--pl-text);
}
body.plinth.plinth-light .pl-tb-seg button.is-on {
	background: var(--pl-surface);
	box-shadow: 0 1px 2px var(--pl-shadow-color);
}
body.plinth .pl-tb-seg .pl-ico {
	width: 14px;
	height: 14px;
}

/* ===== topbar: ⌘K command palette + keyboard shortcuts ===== */
body.plinth .pl-cmdk {
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 110px 16px 16px;
	background: var(--pl-overlay);
	font-family: var(--pl-font);
	font-size: 13px;
	line-height: 1.45;
	text-align: left;
}
body.plinth .pl-cmdk[hidden] {
	display: none;
}
body.plinth .pl-cmdk__box {
	display: flex;
	flex-direction: column;
	width: 660px;
	max-width: 100%;
	max-height: min(560px, calc(100vh - 126px));
	overflow: hidden;
	border: 1px solid var(--pl-border-strong);
	border-radius: 14px;
	background: var(--pl-surface);
	box-shadow: 0 12px 32px var(--pl-shadow-color);
	color: var(--pl-text);
}
body.plinth .pl-cmdk__field {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	gap: 12px;
	height: 58px;
	padding: 0 16px;
	border-bottom: 1px solid var(--pl-border);
	color: var(--pl-text-3);
}
body.plinth .pl-cmdk__field > .pl-ico {
	width: 18px;
	height: 18px;
}
body.plinth .pl-cmdk input.pl-cmdk__input[type="text"],
body.plinth .pl-cmdk input.pl-cmdk__input[type="text"]:focus {
	flex-grow: 1;
	min-width: 0;
	height: 100%;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	outline: none;
	background: transparent;
	box-shadow: none;
	color: var(--pl-text);
	font-family: inherit;
	font-size: 16px;
}
body.plinth .pl-cmdk input.pl-cmdk__input::placeholder {
	color: var(--pl-text-3);
	opacity: 1;
}
body.plinth :is(.pl-cmdk, .pl-tb-pop) kbd.pl-tb-kbd {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	margin: 0;
	padding: 0 5px;
	border: 1px solid var(--pl-border-strong);
	border-radius: 5px;
	background: var(--pl-surface-2);
	color: var(--pl-text-2);
	font-family: inherit;
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
}
body.plinth .pl-cmdk__list {
	flex-grow: 1;
	min-height: 0;
	overflow-y: auto;
	padding-bottom: 6px;
}
body.plinth .pl-cmdk__group {
	padding: 6px 8px 2px;
}
body.plinth .pl-cmdk__head {
	padding: 8px 10px 6px;
	color: var(--pl-text-3);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
}
body.plinth .pl-cmdk__item {
	display: flex;
	align-items: center;
	gap: 12px;
	height: 44px;
	padding: 0 10px;
	border-radius: 9px;
	background: transparent;
	color: var(--pl-text);
	text-decoration: none;
}
body.plinth .pl-cmdk__item:hover,
body.plinth .pl-cmdk__item:focus {
	color: var(--pl-text);
}
body.plinth .pl-cmdk__item.is-on {
	background: var(--pl-surface-2);
}
body.plinth .pl-cmdk__tile {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 8px;
	background: var(--pl-surface-3);
	color: var(--pl-text-2);
}
body.plinth .pl-cmdk__item.is-on .pl-cmdk__tile {
	color: color-mix(in srgb, var(--pl-accent) 55%, var(--pl-text));
}
body.plinth .pl-cmdk__tile .pl-ico {
	width: 15px;
	height: 15px;
}
body.plinth .pl-cmdk__text {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	gap: 1px;
	min-width: 0;
}
body.plinth .pl-cmdk__label,
body.plinth .pl-cmdk__hint {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
body.plinth .pl-cmdk__label {
	font-size: 13.5px;
	font-weight: 500;
}
body.plinth .pl-cmdk__hint {
	color: var(--pl-text-3);
	font-size: 12px;
}
body.plinth .pl-cmdk__open {
	display: none;
	align-items: center;
	gap: 4px;
	color: var(--pl-text-3);
	font-size: 11.5px;
}
body.plinth .pl-cmdk__item.is-on .pl-cmdk__open {
	display: flex;
}
body.plinth .pl-cmdk__open .pl-ico {
	width: 13px;
	height: 13px;
}
body.plinth .pl-cmdk__empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 36px 20px;
	color: var(--pl-text-3);
	font-size: 12.5px;
	text-align: center;
}
body.plinth .pl-cmdk__empty .pl-ico {
	width: 22px;
	height: 22px;
}
body.plinth .pl-cmdk__empty-title {
	color: var(--pl-text-2);
	font-size: 13.5px;
	font-weight: 600;
}
body.plinth .pl-cmdk__foot {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	gap: 14px;
	height: 42px;
	padding: 0 16px;
	border-top: 1px solid var(--pl-border);
	background: var(--pl-chrome);
	color: var(--pl-text-3);
	font-size: 12px;
}
body.plinth .pl-cmdk__foot > span {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	white-space: nowrap;
}
body.plinth .pl-cmdk__foot > .pl-cmdk__name {
	margin-left: auto;
}

/* Keyboard shortcuts. */
body.plinth .pl-cmdk--keys .pl-cmdk__box {
	width: 440px;
}
body.plinth .pl-keys__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 10px 10px 16px;
	border-bottom: 1px solid var(--pl-border);
}
body.plinth .pl-keys__title {
	font-size: 14px;
	font-weight: 600;
}
body.plinth .pl-keys__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 0;
	border-radius: 7px;
	background: transparent;
	color: var(--pl-text-2);
	cursor: pointer;
}
body.plinth .pl-keys__close:hover {
	background: var(--pl-surface-3);
	color: var(--pl-text);
}
body.plinth .pl-keys__list {
	margin: 0;
	padding: 6px 16px 10px;
	list-style: none;
}
body.plinth .pl-keys__list li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0;
	padding: 8px 0;
	border-bottom: 1px solid var(--pl-border);
	color: var(--pl-text-2);
}
body.plinth .pl-keys__list li:last-child {
	border-bottom: 0;
}
body.plinth .pl-keys__combo {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	color: var(--pl-text-3);
	font-size: 12px;
}

/* Phones: full-width panels and a palette nearer the top. */
@media screen and (max-width: 782px) {
	body.plinth .pl-cmdk {
		padding-top: 56px;
	}
	body.plinth .pl-cmdk__box {
		max-height: calc(100vh - 72px);
	}
	body.plinth .pl-cmdk__foot > span:nth-child(3),
	body.plinth .pl-cmdk__foot > .pl-cmdk__name {
		display: none;
	}
	body.plinth .pl-cmdk__item {
		height: 48px;
	}
}
