:root {
	--bg: #0b1220;
	--panel: #0f1a2e;
	--panel2: #121f36;
	--text: #e6ecff;
	--muted: rgba(230, 236, 255, 0.7);
	--border: rgba(230, 236, 255, 0.12);
	--accent: #7c5cff;
	--accent2: #22c55e;
	--danger: #ef4444;
	--warn: #f59e0b;
	--shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
	--radius: 14px;
}

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&display=swap');

body {
	background: radial-gradient(1200px 800px at 10% 10%, rgba(124, 92, 255, 0.20), transparent 55%),
		radial-gradient(900px 700px at 90% 0%, rgba(34, 197, 94, 0.18), transparent 55%),
		var(--bg);
	color: var(--text);
	font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
	color-scheme: dark;
}

a {
	color: var(--text);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

.moap-app {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.moap-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px;
	border: 1px solid var(--border);
	background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

.moap-topbar-title {
	font-weight: 700;
	letter-spacing: 0.2px;
}

.moap-topbar-logo {
	display: block;
	width: 44px;
	height: 44px;
}

.moap-tabs {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.moap-tab {
	border: 1px solid var(--border);
	background: rgba(255,255,255,0.04);
	color: var(--text);
	padding: 8px 10px;
	border-radius: 999px;
	cursor: pointer;
	font-size: 13px;
}

.moap-tab[data-active="1"] {
	border-color: rgba(124, 92, 255, 0.65);
	background: rgba(124, 92, 255, 0.18);
}

.moap-panel {
	border: 1px solid var(--border);
	background: rgba(255,255,255,0.03);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	overflow: hidden;
}

.moap-panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 14px;
	border-bottom: 1px solid var(--border);
	background: rgba(0,0,0,0.18);
}

.moap-panel-title {
	font-weight: 600;
}

.moap-actions {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
}

.moap-input {
	background: rgba(255,255,255,0.04);
	border: 1px solid var(--border);
	color: var(--text);
	padding: 8px 10px;
	border-radius: 10px;
	outline: none;
}

.moap-input::placeholder {
	color: rgba(230, 236, 255, 0.45);
}

.moap-select {
	appearance: none;
	background: rgba(255,255,255,0.04);
	border: 1px solid var(--border);
	color: var(--text);
	padding: 8px 34px 8px 10px;
	border-radius: 10px;
	outline: none;
	background-image: linear-gradient(45deg, transparent 50%, rgba(230, 236, 255, 0.70) 50%),
		linear-gradient(135deg, rgba(230, 236, 255, 0.70) 50%, transparent 50%);
	background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 13px) calc(50% - 3px);
	background-size: 6px 6px, 6px 6px;
	background-repeat: no-repeat;
}

.moap-select:focus {
	border-color: rgba(124, 92, 255, 0.65);
	box-shadow: 0 0 0 2px rgba(124, 92, 255, 0.20);
}

.moap-select option,
.moap-select optgroup {
	background: var(--panel2);
	color: var(--text);
}

.moap-select-wrap {
	position: relative;
	display: inline-block;
}

.moap-select-trigger {
	appearance: none;
	background: rgba(255,255,255,0.04);
	border: 1px solid var(--border);
	color: var(--text);
	padding: 8px 34px 8px 10px;
	border-radius: 10px;
	outline: none;
	cursor: pointer;
	text-align: left;
	min-width: 180px;
	background-image: linear-gradient(45deg, transparent 50%, rgba(230, 236, 255, 0.70) 50%),
		linear-gradient(135deg, rgba(230, 236, 255, 0.70) 50%, transparent 50%);
	background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 13px) calc(50% - 3px);
	background-size: 6px 6px, 6px 6px;
	background-repeat: no-repeat;
}

.moap-select-trigger:hover {
	background: rgba(255,255,255,0.08);
}

.moap-select-trigger:focus {
	border-color: rgba(124, 92, 255, 0.65);
	box-shadow: 0 0 0 2px rgba(124, 92, 255, 0.20);
}

.moap-select-menu {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(100% + 6px);
	border: 1px solid rgba(230, 236, 255, 0.14);
	background: var(--panel2);
	border-radius: 12px;
	box-shadow: var(--shadow);
	padding: 6px;
	z-index: 10001;
	max-height: 260px;
	overflow: auto;
}

.moap-select-item {
	width: 100%;
	display: block;
	border: 1px solid transparent;
	background: transparent;
	color: rgba(230, 236, 255, 0.92);
	padding: 8px 10px;
	border-radius: 10px;
	text-align: left;
	cursor: pointer;
}

.moap-select-item:hover {
	background: rgba(124, 92, 255, 0.14);
	border-color: rgba(124, 92, 255, 0.35);
}

.moap-select-item[data-active="1"] {
	background: rgba(124, 92, 255, 0.24);
	border-color: rgba(124, 92, 255, 0.65);
	color: var(--text);
}

.moap-btn {
	border: 1px solid var(--border);
	background: rgba(255,255,255,0.06);
	color: var(--text);
	padding: 8px 10px;
	border-radius: 12px;
	cursor: pointer;
	font-size: 13px;
}

.moap-btn:hover {
	background: rgba(255,255,255,0.10);
}

.moap-btn-primary {
	border-color: rgba(124, 92, 255, 0.65);
	background: rgba(124, 92, 255, 0.22);
}

.moap-btn-danger {
	border-color: rgba(239, 68, 68, 0.65);
	background: rgba(239, 68, 68, 0.18);
}

.moap-table-wrap {
	overflow-x: auto;
}

.moap-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.moap-table th,
.moap-table td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--border);
	vertical-align: top;
	white-space: nowrap;
}

.moap-table tbody tr[data-editing="1"] {
	background: rgba(124, 92, 255, 0.14);
	outline: 1px solid rgba(124, 92, 255, 0.45);
}

.moap-table tbody tr[data-editing="1"] td {
	border-bottom-color: rgba(124, 92, 255, 0.35);
}

.moap-table tbody tr[data-locked="1"] {
	opacity: 0.60;
}

.moap-table th {
	text-align: left;
	font-size: 12px;
	color: var(--muted);
	font-weight: 600;
}

.moap-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	border-radius: 999px;
	border: 1px solid var(--border);
	background: rgba(255,255,255,0.04);
	font-size: 12px;
	color: var(--muted);
}

.moap-pill[data-kind="good"] {
	border-color: rgba(34, 197, 94, 0.65);
	background: rgba(34, 197, 94, 0.12);
	color: rgba(230, 236, 255, 0.9);
}

.moap-pill[data-kind="masked"] {
	border-color: rgba(236, 72, 153, 0.70);
	background: rgba(236, 72, 153, 0.18);
	color: rgba(230, 236, 255, 0.92);
}

.moap-pill[data-kind="bad"] {
	border-color: rgba(239, 68, 68, 0.65);
	background: rgba(239, 68, 68, 0.12);
	color: rgba(230, 236, 255, 0.9);
}

.moap-modal-backdrop {
	position: fixed;
	left: 0;
	top: 0;
	right: 0;
	bottom: 0;
	background: rgba(0,0,0,0.7);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9999;
	padding: 18px;
}

.moap-modal {
	width: min(900px, 100%);
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	overflow: hidden;
}

.moap-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 14px;
	border-bottom: 1px solid var(--border);
	background: var(--panel2);
}

.moap-modal-body {
	padding: 14px;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.moap-modal-footer {
	padding: 14px;
	border-top: 1px solid var(--border);
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	background: var(--panel2);
}

.moap-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.moap-label {
	font-size: 12px;
	color: var(--muted);
}

.moap-note {
	font-size: 12px;
	color: rgba(230, 236, 255, 0.55);
}

.moap-help {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	margin-left: 6px;
	margin-right: 2px;
	border-radius: 999px;
	border: 1px solid rgba(230, 236, 255, 0.22);
	background: rgba(255,255,255,0.06);
	color: rgba(230, 236, 255, 0.85);
	font-size: 11px;
	line-height: 1;
	cursor: help;
	user-select: none;
}

.moap-help:hover {
	border-color: rgba(124, 92, 255, 0.65);
	background: rgba(124, 92, 255, 0.18);
}

.moap-toast {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 10000;
	max-width: 420px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.moap-toast-item {
	border: 1px solid var(--border);
	border-radius: 14px;
	padding: 12px 14px;
	background: var(--panel2);
}

.moap-toast-item[data-kind="success"] {
	border-color: rgba(34, 197, 94, 0.55);
}

.moap-toast-item[data-kind="error"] {
	border-color: rgba(239, 68, 68, 0.55);
}

.moap-toast-title {
	font-weight: 700;
	font-size: 13px;
}

.moap-toast-msg {
	font-size: 13px;
	color: rgba(230, 236, 255, 0.8);
	margin-top: 4px;
}

@media (max-width: 700px) {
	.moap-modal-body {
		grid-template-columns: 1fr;
	}
}
