/*
 * Pump Dashboard — site-cohesive theme.
 *
 * Uses the same fonts, palette, and spacing language as the rest of three.ws
 * (Space Grotesk for headings, Inter for body, JetBrains Mono for code and
 * addresses). Replaces the previous terminal-grayscale theme.
 */

html.pump-dashboard-page,
html.pump-dashboard-page body {
	overflow: auto !important;
	height: auto !important;
}

.pump-dashboard-page body {
	display: block;
	margin: 0;
	background: #000;
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 14px;
	line-height: 1.55;
	min-height: 100vh;
	-webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }

/* ── App shell ────────────────────────────────────────────── */

.pd-app {
	display: flex;
	min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */

.pd-sidebar {
	width: 232px;
	background: linear-gradient(180deg, rgba(10, 10, 10, 0.94) 0%, rgba(0, 0, 0, 0.94) 100%);
	border-right: 1px solid var(--stroke);
	display: flex;
	flex-direction: column;
	position: fixed;
	top: 0; left: 0; bottom: 0;
	z-index: 20;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

.pd-sidebar::-webkit-scrollbar { width: 4px; }
.pd-sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 2px; }

.pd-sidebar-head {
	padding: 1.1rem 1.1rem 0.75rem;
	border-bottom: 1px solid var(--stroke);
}

.pd-sidebar-brand {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-family: var(--font-display);
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--accent);
	text-decoration: none;
	margin-bottom: 0.4rem;
}

.pd-sidebar-brand img { height: 18px; width: auto; }

.pd-sidebar-eyebrow {
	font-family: var(--font-display);
	font-size: 0.62rem;
	font-weight: 700;
	color: var(--accent);
	letter-spacing: 0.12em;
	text-transform: uppercase;
	margin-top: 0.2rem;
}

.pd-sidebar nav {
	flex: 1;
	padding: 0.85rem 0.6rem;
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

.pd-nav-section {
	font-family: var(--font-display);
	font-size: 0.62rem;
	font-weight: 700;
	color: var(--ink-dim);
	letter-spacing: 0.12em;
	text-transform: uppercase;
	padding: 0.85rem 0.55rem 0.35rem;
}

.pd-sidebar nav a {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.5rem 0.65rem;
	border-radius: var(--radius-md);
	color: var(--ink-dim);
	text-decoration: none;
	font-size: 0.85rem;
	font-weight: 500;
	transition: background 0.12s ease, color 0.12s ease;
}

.pd-sidebar nav a svg {
	width: 14px;
	height: 14px;
	opacity: 0.7;
	flex-shrink: 0;
	transition: opacity 0.12s ease;
}

.pd-sidebar nav a:hover {
	background: rgba(255, 255, 255, 0.035);
	color: var(--accent);
}

.pd-sidebar nav a:hover svg { opacity: 1; }

.pd-sidebar nav a.is-active {
	background: var(--accent-soft);
	color: var(--ink);
	border-left: 2px solid var(--accent);
	padding-left: calc(0.65rem - 2px);
}

.pd-sidebar nav a.is-active svg { opacity: 1; }

.pd-sidebar-foot {
	padding: 0.75rem 1rem;
	border-top: 1px solid var(--stroke);
	font-family: var(--font-mono);
	font-size: 0.72rem;
	color: var(--ink-dim);
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.pd-sidebar-back {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-family: var(--font-body);
	font-size: 0.78rem;
	color: var(--ink-dim);
	text-decoration: none;
	transition: color 0.15s ease;
}

.pd-sidebar-back:hover { color: var(--accent); }
.pd-sidebar-back:focus-visible {
	outline: 2px solid var(--stroke-strong);
	outline-offset: 2px;
	border-radius: var(--radius-md);
}

/* ── Main column ─────────────────────────────────────────── */

.pd-main {
	margin-left: 232px;
	flex: 1;
	min-width: 0;
	padding: 1.5rem clamp(1rem, 3vw, 2rem) 3rem;
}

.pd-topbar {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	margin-bottom: 1.5rem;
	flex-wrap: wrap;
}

.pd-page-title {
	font-family: var(--font-display);
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: -0.015em;
	color: var(--accent);
	margin: 0;
}

.pd-spacer { flex: 1; }

.pd-status-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.35rem 0.7rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.025);
	border: 1px solid var(--stroke);
	font-family: var(--font-mono);
	font-size: 0.7rem;
	color: var(--ink-dim);
	letter-spacing: 0.02em;
}

.pd-status-chip .pd-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--ink-dim);
	transition: background 0.2s ease, box-shadow 0.2s ease;
}

.pd-status-chip .pd-dot.is-on {
	background: var(--success);
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.16);
}

.pd-status-chip .pd-dot.is-err {
	background: var(--danger);
	box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.18);
}

.pd-status-chip .pd-dot.is-warm {
	background: var(--warn);
	box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.18);
	animation: pd-pulse 1.4s ease-in-out infinite;
}

@keyframes pd-pulse {
	0%, 100% { opacity: 0.55; }
	50%      { opacity: 1; }
}

/* ── Page (SPA view) ─────────────────────────────────────── */

.pd-page { display: none; animation: pd-fade 0.18s ease-out; }
.pd-page.is-active { display: block; }

@keyframes pd-fade {
	from { opacity: 0; transform: translateY(4px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ── Panel ────────────────────────────────────────────────── */

.pd-panel {
	background: var(--surface-1);
	border: 1px solid var(--stroke);
	border-radius: var(--radius-control);
	overflow: hidden;
	margin-bottom: 1rem;
}

.pd-panel-head {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.85rem 1.1rem;
	border-bottom: 1px solid var(--stroke);
	background: rgba(255, 255, 255, 0.012);
}

.pd-panel-head h2 {
	font-family: var(--font-display);
	font-size: 0.86rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--accent);
	margin: 0;
	text-transform: uppercase;
}

.pd-panel-body { padding: 1.1rem; }
.pd-panel-body.no-pad { padding: 0; }

/* ── Dashboard grid ──────────────────────────────────────── */

.pd-dash-grid {
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	gap: 1rem;
}

.pd-mod-4  { grid-column: span 4; }
.pd-mod-6  { grid-column: span 6; }
.pd-mod-8  { grid-column: span 8; }
.pd-mod-12 { grid-column: span 12; }

/* ── Featured agent card ─────────────────────────────────── */

.pd-featured {
	display: flex;
	gap: 1.1rem;
	align-items: flex-start;
	min-height: 200px;
}

.pd-featured-avatar {
	flex-shrink: 0;
	width: 160px;
	height: 200px;
	border-radius: var(--radius-md);
	background:
		radial-gradient(ellipse at center top, rgba(255, 255, 255, 0.08) 0%, transparent 70%),
		var(--surface-1);
	border: 1px solid var(--stroke);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.pd-featured-avatar model-viewer,
.pd-featured-avatar iframe,
.pd-featured-avatar img {
	width: 100%;
	height: 100%;
	border: none;
	background: transparent;
}

.pd-featured-info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.pd-featured-name {
	font-family: var(--font-display);
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--accent);
	letter-spacing: -0.01em;
	margin-bottom: 0.4rem;
}

.pd-featured-desc {
	font-size: 0.88rem;
	color: var(--ink-dim);
	line-height: 1.55;
	margin-bottom: 0.85rem;
	flex: 1;
}

.pd-featured-stats {
	display: flex;
	gap: 0.6rem;
	flex-wrap: wrap;
	margin-bottom: 0.85rem;
}

.pd-featured-stat {
	padding: 0.35rem 0.6rem;
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid var(--stroke);
	font-family: var(--font-mono);
	font-size: 0.72rem;
	color: var(--ink);
}

.pd-featured-stat-label {
	color: var(--ink-dim);
	margin-right: 0.35rem;
}

/* ── Mini stat cards ─────────────────────────────────────── */

.pd-stat-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
	gap: 0.7rem;
}

.pd-stat {
	background: var(--surface-1);
	border: 1px solid var(--stroke);
	border-radius: var(--radius-md);
	padding: 0.85rem 1rem;
}

.pd-stat-label {
	font-family: var(--font-display);
	font-size: 0.62rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ink-dim);
	margin-bottom: 0.45rem;
}

.pd-stat-value {
	font-family: var(--font-mono);
	font-size: 1.5rem;
	font-weight: 600;
	color: var(--accent);
	line-height: 1.1;
	letter-spacing: -0.01em;
}

.pd-stat-value.is-success { color: var(--success); }
.pd-stat-value.is-warn    { color: var(--warn); }
.pd-stat-value.is-danger  { color: var(--danger); }

.pd-stat-sub {
	margin-top: 0.3rem;
	font-size: 0.74rem;
	color: var(--ink-dim);
}

/* ── Tables ──────────────────────────────────────────────── */

.pd-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.85rem;
}

.pd-table th,
.pd-table td {
	padding: 0.65rem 1rem;
	border-bottom: 1px solid var(--stroke);
	text-align: left;
	vertical-align: middle;
}

.pd-table th {
	font-family: var(--font-display);
	font-size: 0.66rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ink-dim);
	background: rgba(255, 255, 255, 0.012);
}

.pd-table tbody tr {
	transition: background 0.12s ease;
}

.pd-table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.pd-table tbody tr:last-child td { border-bottom: none; }

/* Deep-linked agent row (?agent=<id>) — subtle accent wash + left marker. */
.pd-table tbody tr.is-focused {
	background: color-mix(in srgb, var(--accent) 12%, transparent);
	box-shadow: inset 3px 0 0 var(--accent);
}
.pd-table tbody tr.is-focused:hover {
	background: color-mix(in srgb, var(--accent) 16%, transparent);
}

.pd-table .pd-addr {
	font-family: var(--font-mono);
	font-size: 0.78rem;
	color: var(--accent);
	text-decoration: none;
}

.pd-table .pd-addr:hover { color: var(--ink); }

.pd-table .pd-empty {
	color: var(--ink-dim);
	text-align: center;
	padding: 2.5rem 1rem;
	font-size: 0.88rem;
}

/* ── Tags ────────────────────────────────────────────────── */

.pd-tag {
	display: inline-flex;
	align-items: center;
	padding: 0.18rem 0.55rem;
	border-radius: 999px;
	font-family: var(--font-display);
	font-size: 0.65rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	background: var(--surface-1);
	border: 1px solid var(--stroke);
	color: var(--ink-dim);
}

.pd-tag.is-launch  { background: var(--accent-soft); border-color: var(--stroke-strong); color: var(--ink); }
.pd-tag.is-buy     { background: rgba(74, 222, 128, 0.14); border-color: rgba(74, 222, 128, 0.3); color: var(--success); }
.pd-tag.is-sell    { background: rgba(248, 113, 113, 0.14); border-color: rgba(248, 113, 113, 0.32); color: var(--danger); }
.pd-tag.is-whale   { background: rgba(251, 191, 36, 0.14); border-color: rgba(251, 191, 36, 0.3); color: var(--warn); }
.pd-tag.is-grad    { background: var(--accent-soft); border-color: var(--stroke-strong); color: var(--accent); }
.pd-tag.is-claim   { background: rgba(74, 222, 128, 0.14); border-color: rgba(74, 222, 128, 0.3); color: var(--success); }
.pd-tag.is-signal  { background: rgba(129, 140, 248, 0.14); border-color: rgba(129, 140, 248, 0.32); color: #a5b4fc; }

/* ── Live feed ───────────────────────────────────────────── */

.pd-feed {
	max-height: 480px;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

.pd-feed::-webkit-scrollbar { width: 6px; }
.pd-feed::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 3px; }

.pd-feed-item {
	display: grid;
	grid-template-columns: 70px 70px 1fr;
	gap: 0.85rem;
	padding: 0.65rem 1.1rem;
	border-bottom: 1px solid var(--stroke);
	font-size: 0.85rem;
	animation: pd-feed-in 0.25s ease-out;
}

@keyframes pd-feed-in {
	from { opacity: 0; transform: translateX(-6px); }
	to   { opacity: 1; transform: translateX(0); }
}

/* During high-rate feed bursts, animating every prepended row at once is the
   main source of jank — the JS toggles this class to skip the entry animation. */
.pd-no-anim .pd-feed-item { animation: none; }

/* Respect users who ask the OS to minimize motion. */
@media (prefers-reduced-motion: reduce) {
	.pd-feed-item { animation: none; }
}

.pd-feed-item:last-child { border-bottom: none; }

.pd-feed-time {
	font-family: var(--font-mono);
	font-size: 0.74rem;
	color: var(--ink-dim);
	align-self: center;
}

.pd-feed-tag-col { align-self: center; }

.pd-feed-body { min-width: 0; }

.pd-feed-title {
	color: var(--accent);
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pd-feed-detail {
	color: var(--ink-dim);
	font-size: 0.78rem;
	font-family: var(--font-mono);
}

.pd-empty {
	padding: 3rem 1.5rem;
	text-align: center;
	color: var(--ink-dim);
	font-size: 0.9rem;
}

.pd-empty svg {
	width: 28px;
	height: 28px;
	opacity: 0.4;
	margin-bottom: 0.55rem;
}

/* ── Forms ───────────────────────────────────────────────── */

.pd-form-group {
	margin-bottom: 0.85rem;
}

.pd-form-group label {
	display: block;
	font-family: var(--font-display);
	font-size: 0.7rem;
	font-weight: 700;
	color: var(--ink-dim);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	margin-bottom: 0.35rem;
}

.pd-form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.7rem;
}

.pd-form-inline {
	display: flex;
	gap: 0.7rem;
	align-items: flex-end;
	flex-wrap: wrap;
	margin-bottom: 1rem;
}

.pd-form-inline .pd-form-group { margin-bottom: 0; }

.pd-input,
.pd-select,
.pd-textarea {
	width: 100%;
	padding: 0.55rem 0.75rem;
	background: var(--surface-1);
	border: 1px solid var(--stroke);
	border-radius: var(--radius-md);
	color: var(--accent);
	font-family: var(--font-mono);
	font-size: 0.82rem;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.pd-input:focus,
.pd-select:focus,
.pd-textarea:focus {
	outline: none;
	border-color: var(--stroke-strong);
	background: var(--surface-2);
}

.pd-input::placeholder { color: var(--ink-dim); }

.pd-input[type="number"] {
	font-variant-numeric: tabular-nums;
}

/* ── Buttons ─────────────────────────────────────────────── */

.pd-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	padding: 0.55rem 0.95rem;
	border-radius: var(--radius-md);
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--stroke);
	color: var(--accent);
	font-family: var(--font-body);
	font-size: 0.82rem;
	font-weight: 500;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
	white-space: nowrap;
}

.pd-btn:hover {
	background: rgba(255, 255, 255, 0.07);
	border-color: var(--stroke-strong);
}

.pd-btn:active { transform: translateY(1px); }

/* Inert state — used while a form's server config / save is in flight. Suppress
   the hover lightening and active nudge so a disabled control reads as inert. */
.pd-btn:disabled,
.pd-btn[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}
.pd-btn:disabled:hover,
.pd-btn[disabled]:hover {
	background: rgba(255, 255, 255, 0.04);
	border-color: var(--stroke);
}
.pd-btn.is-primary:disabled:hover,
.pd-btn.is-primary[disabled]:hover {
	background: var(--accent-soft);
	border-color: var(--stroke-strong);
}
.pd-btn:disabled:active,
.pd-btn[disabled]:active { transform: none; }

/* Disabled inputs (alerts form during the in-flight GET). */
[aria-busy='true'] .pd-input:disabled,
[aria-busy='true'] .pd-toggle:disabled,
.pd-input:disabled,
.pd-toggle:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.pd-btn.is-primary {
	background: var(--accent-soft);
	border-color: var(--stroke-strong);
	color: var(--ink);
}

.pd-btn.is-primary:hover {
	background: rgba(255, 255, 255, 0.14);
	border-color: rgba(255, 255, 255, 0.35);
}

.pd-btn.is-danger {
	background: rgba(248, 113, 113, 0.14);
	border-color: rgba(248, 113, 113, 0.32);
	color: var(--danger);
}

.pd-btn.is-danger:hover {
	background: rgba(248, 113, 113, 0.24);
	border-color: rgba(248, 113, 113, 0.55);
}

.pd-btn-sm {
	padding: 0.35rem 0.6rem;
	font-size: 0.74rem;
}

.pd-btn svg {
	width: 12px;
	height: 12px;
	flex-shrink: 0;
}

/* ── Toggles ─────────────────────────────────────────────── */

.pd-toggle-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.65rem 0;
	border-bottom: 1px solid var(--stroke);
}

.pd-toggle-row:last-child { border-bottom: none; }

.pd-toggle-label {
	flex: 1;
	font-size: 0.88rem;
	color: var(--accent);
}

.pd-toggle-sub {
	font-size: 0.75rem;
	color: var(--ink-dim);
	margin-top: 0.2rem;
}

.pd-toggle {
	appearance: none;
	width: 32px;
	height: 18px;
	border-radius: 999px;
	background: var(--surface-1);
	border: 1px solid var(--stroke);
	position: relative;
	cursor: pointer;
	transition: background 0.15s ease;
	flex-shrink: 0;
	margin-top: 2px;
}

.pd-toggle::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 2px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--ink-dim);
	transform: translateY(-50%);
	transition: left 0.15s ease, background 0.15s ease;
}

.pd-toggle:checked {
	background: var(--accent-soft);
	border-color: var(--stroke-strong);
}

.pd-toggle:checked::after {
	left: calc(100% - 14px);
	background: var(--accent);
}

/* ── Filter pills ────────────────────────────────────────── */

.pd-filter-row {
	display: flex;
	gap: 0.4rem;
	flex-wrap: wrap;
	padding: 0.85rem 1.1rem;
	border-bottom: 1px solid var(--stroke);
}

.pd-filter-btn {
	padding: 0.32rem 0.7rem;
	border-radius: 999px;
	background: transparent;
	border: 1px solid var(--stroke);
	color: var(--ink-dim);
	font-family: var(--font-display);
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.pd-filter-btn:hover {
	border-color: var(--stroke-strong);
	color: var(--accent);
}

.pd-filter-btn.is-active {
	background: var(--accent-soft);
	border-color: var(--stroke-strong);
	color: var(--ink);
}

/* ── Badge ───────────────────────────────────────────────── */

.pd-badge {
	display: inline-flex;
	align-items: center;
	padding: 0.15rem 0.5rem;
	border-radius: 999px;
	background: var(--surface-1);
	border: 1px solid var(--stroke);
	font-family: var(--font-mono);
	font-size: 0.7rem;
	color: var(--ink-dim);
	font-variant-numeric: tabular-nums;
}

/* ── Toast ───────────────────────────────────────────────── */

.pd-toast-container {
	position: fixed;
	top: 1rem;
	right: 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	z-index: 9999;
	pointer-events: none;
}

.pd-toast {
	padding: 0.65rem 0.95rem;
	border-radius: var(--radius-md);
	background: var(--surface-1);
	border: 1px solid var(--stroke-strong);
	color: var(--accent);
	font-size: 0.85rem;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
	animation: pd-toast-in 0.2s ease-out;
	pointer-events: auto;
	max-width: 360px;
}

.pd-toast.is-success { border-left: 3px solid var(--success); }
.pd-toast.is-error   { border-left: 3px solid var(--danger); }
.pd-toast.is-info    { border-left: 3px solid var(--accent); }

@keyframes pd-toast-in {
	from { opacity: 0; transform: translateX(8px); }
	to   { opacity: 1; transform: translateX(0); }
}

/* ── Modals ──────────────────────────────────────────────── */

.pd-modal-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 1000;
	padding: 1rem;
	backdrop-filter: blur(4px);
}

.pd-modal-backdrop.is-open { display: flex; }

.pd-modal {
	background: var(--surface-1);
	border: 1px solid var(--stroke-strong);
	border-radius: var(--radius-control);
	padding: 1.5rem;
	max-width: 520px;
	width: 100%;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.pd-modal h3 {
	font-family: var(--font-display);
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--accent);
	margin: 0 0 1rem;
	letter-spacing: -0.01em;
}

.pd-modal-actions {
	display: flex;
	gap: 0.5rem;
	justify-content: flex-end;
	margin-top: 1.25rem;
}

/* ── Config-grid (two-column form layout) ───────────────── */

.pd-config-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}

/* ── Misc ────────────────────────────────────────────────── */

.pd-mono { font-family: var(--font-mono); }

code, .pd-mono-inline {
	font-family: var(--font-mono);
	font-size: 0.86em;
	padding: 0.1em 0.35em;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid var(--stroke);
	border-radius: 4px;
	color: var(--ink);
}

.pd-callout {
	padding: 0.85rem 1rem;
	border-radius: var(--radius-md);
	background: var(--accent-soft);
	border: 1px solid var(--stroke-strong);
	color: var(--ink);
	font-size: 0.85rem;
	line-height: 1.55;
}

.pd-callout a { color: var(--ink); }

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 960px) {
	.pd-dash-grid { grid-template-columns: 1fr; }
	.pd-mod-4, .pd-mod-6, .pd-mod-8, .pd-mod-12 { grid-column: span 1; }
	.pd-config-grid { grid-template-columns: 1fr; }
	.pd-form-row { grid-template-columns: 1fr; }
	.pd-featured { flex-direction: column; }
	.pd-featured-avatar { width: 100%; height: 240px; }
}

@media (max-width: 760px) {
	.pd-sidebar {
		transform: translateX(-100%);
		transition: transform 0.2s ease;
	}
	.pd-sidebar.is-open { transform: translateX(0); }
	.pd-main { margin-left: 0; padding: 1rem; }
	.pd-feed-item { grid-template-columns: 56px 60px 1fr; gap: 0.5rem; padding: 0.55rem 0.75rem; }
}

/* ── Alerts: rule builder + rule list ────────────────────── */

.pd-alert-grid {
	display: grid;
	grid-template-columns: minmax(0, 360px) 1fr;
	gap: 1rem;
	margin-bottom: 1rem;
	align-items: start;
}

@media (max-width: 960px) {
	.pd-alert-grid { grid-template-columns: 1fr; }
}

.pd-muted { color: var(--ink-dim); }

.pd-link { color: var(--accent); }

.pd-field-hint {
	margin-top: 0.3rem;
	font-size: 0.72rem;
	line-height: 1.45;
	color: var(--ink-dim);
}

/* Delivery channels block in the create/edit form */
.pd-rule-channels {
	margin: 0.4rem 0 0.9rem;
	padding: 0.85rem;
	border: 1px solid var(--stroke);
	border-radius: var(--radius-md);
	background: rgba(255, 255, 255, 0.02);
}
.pd-rule-channels-title {
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--ink-dim);
	margin-bottom: 0.6rem;
}
.pd-check {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.85rem;
	color: var(--ink);
	cursor: pointer;
	margin-bottom: 0.7rem;
}
.pd-check input { accent-color: var(--accent); width: 15px; height: 15px; }

.pd-rule-signin-note {
	margin-top: 0.7rem;
	font-size: 0.78rem;
	color: var(--ink-dim);
}

/* Rule list */
.pd-rules-list {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	padding: 0.75rem;
	transition: opacity 0.15s ease;
}
.pd-rules-list[aria-busy='true'] { opacity: 0.5; }
.pd-rules-empty strong { color: var(--ink); }

.pd-rule-card {
	display: grid;
	grid-template-columns: 34px 1fr auto;
	gap: 0.75rem;
	align-items: start;
	padding: 0.85rem;
	border: 1px solid var(--stroke);
	border-radius: var(--radius-md);
	background: rgba(255, 255, 255, 0.025);
	transition: border-color 0.12s ease, background 0.12s ease, opacity 0.12s ease;
}
.pd-rule-card:hover { border-color: var(--stroke-strong); background: rgba(255, 255, 255, 0.04); }
.pd-rule-card.is-disabled { opacity: 0.55; }

.pd-rule-icon { font-size: 1.25rem; line-height: 1.6; text-align: center; }

.pd-rule-body { min-width: 0; }
.pd-rule-title {
	font-weight: 600;
	font-size: 0.9rem;
	color: var(--ink);
	margin-bottom: 0.15rem;
	overflow-wrap: anywhere;
}
.pd-rule-summary { font-size: 0.8rem; color: var(--ink-dim); line-height: 1.5; }
.pd-rule-summary .pd-mono { color: var(--ink); }

.pd-rule-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-top: 0.55rem;
}
.pd-rule-tag {
	font-size: 0.68rem;
	color: var(--ink-dim);
	padding: 0.12rem 0.45rem;
	border: 1px solid var(--stroke);
	border-radius: 999px;
}
.pd-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	font-size: 0.68rem;
	color: var(--ink);
	padding: 0.12rem 0.45rem;
	border: 1px solid var(--stroke-strong);
	border-radius: 999px;
	background: var(--accent-soft);
}
.pd-chip-action {
	background: none;
	border: none;
	color: var(--accent);
	font: inherit;
	font-size: 0.66rem;
	cursor: pointer;
	padding: 0;
	text-decoration: underline;
}

.pd-rule-secret-row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-top: 0.5rem;
	font-size: 0.72rem;
}
.pd-rule-secret-code {
	font-family: var(--font-mono);
	font-size: 0.7rem;
	color: var(--ink);
	background: rgba(255, 255, 255, 0.06);
	padding: 0.15rem 0.4rem;
	border-radius: 4px;
	overflow-wrap: anywhere;
}

.pd-rule-fail {
	margin-top: 0.5rem;
	font-size: 0.74rem;
	color: var(--warn);
}

.pd-rule-actions {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.4rem;
}

.pd-btn-xs { padding: 0.18rem 0.45rem; font-size: 0.68rem; }

.pd-feed-legend { font-size: 0.72rem; color: var(--ink-dim); margin-left: 0.6rem; }

/* Enable/disable switch */
.pd-switch { position: relative; display: inline-flex; cursor: pointer; }
.pd-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.pd-switch-track {
	width: 34px;
	height: 19px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.12);
	border: 1px solid var(--stroke);
	transition: background 0.15s ease;
	display: inline-flex;
	align-items: center;
	padding: 0 2px;
}
.pd-switch-thumb {
	width: 13px;
	height: 13px;
	border-radius: 50%;
	background: var(--ink);
	transition: transform 0.15s ease;
}
.pd-switch input:checked + .pd-switch-track { background: var(--accent); }
.pd-switch input:checked + .pd-switch-track .pd-switch-thumb { transform: translateX(15px); }
.pd-switch input:focus-visible + .pd-switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
