@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
	--mw-ink: #0c0f14;
	--mw-surface: #14181f;
	--mw-surface-raised: #1b2129;
	--mw-border: rgba(255,255,255,0.09);
	--mw-border-strong: rgba(255,255,255,0.16);
	--mw-text: rgba(255,255,255,0.94);
	--mw-text-dim: rgba(255,255,255,0.78);

	/* Seal states — the signature visual language */
	--mw-seal-held: #c9974c;
	--mw-seal-held-glow: rgba(201,151,76,0.18);
	--mw-seal-released: #4fba6e;
	--mw-seal-released-glow: rgba(79,186,110,0.18);
	--mw-seal-disputed: #e2574c;
	--mw-seal-disputed-glow: rgba(226,87,76,0.2);
	--mw-seal-refunded: #6e8fd9;
	--mw-seal-refunded-glow: rgba(110,143,217,0.18);
	--mw-seal-pending: rgba(255,255,255,0.45);

	--mw-radius-sm: 10px;
	--mw-radius: 16px;
	--mw-radius-lg: 22px;
	--mw-font-display: 'Space Grotesk', sans-serif;
	--mw-font-body: 'IBM Plex Sans', sans-serif;
	--mw-font-mono: 'IBM Plex Mono', monospace;
}

@media (prefers-reduced-motion: reduce) {
	* { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

.mw-portal {
	font-family: var(--mw-font-body);
	color: var(--mw-text);
	font-size: 17px;
	line-height: 1.6;
	background:
		radial-gradient(ellipse 900px 500px at 15% -10%, rgba(201,151,76,0.06), transparent 60%),
		var(--mw-ink);
}
.mw-portal h1, .mw-portal h2, .mw-portal h3 { font-family: var(--mw-font-display); font-weight: 600; color: var(--mw-text); letter-spacing: -0.01em; }
.mw-portal h1 { font-size: 28px; }
.mw-portal h2 { font-size: 21px; margin-bottom: 4px; }
.mw-mono { font-family: var(--mw-font-mono); font-variant-numeric: tabular-nums; }
.mw-label { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mw-text-dim); font-weight: 500; }
.mw-subtitle { font-size: 15px; color: var(--mw-text-dim); margin: 4px 0 24px; }

/* ---- The Escrow Seal — signature component ---- */
.mw-seal {
	--seal-color: var(--mw-seal-pending);
	--seal-glow: transparent;
	width: 44px; height: 44px;
	border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	position: relative; flex-shrink: 0;
	background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--seal-color) 35%, transparent), transparent 70%), var(--mw-surface-raised);
	border: 2px solid var(--seal-color);
	box-shadow: 0 0 0 6px var(--seal-glow);
	transition: box-shadow 0.4s ease, border-color 0.4s ease;
}
.mw-seal svg { width: 20px; height: 20px; stroke: var(--seal-color); transition: stroke 0.4s ease; }
.mw-seal-lg { width: 72px; height: 72px; }
.mw-seal-lg svg { width: 32px; height: 32px; }
.mw-seal-sm { width: 30px; height: 30px; }
.mw-seal-sm svg { width: 14px; height: 14px; }
.mw-seal[data-status="held"]      { --seal-color: var(--mw-seal-held); --seal-glow: var(--mw-seal-held-glow); }
.mw-seal[data-status="pending"]   { --seal-color: var(--mw-seal-pending); --seal-glow: transparent; }
.mw-seal[data-status="released"],
.mw-seal[data-status="resolved_seller"],
.mw-seal[data-status="resolved_split"] { --seal-color: var(--mw-seal-released); --seal-glow: var(--mw-seal-released-glow); }
.mw-seal[data-status="disputed"]  { --seal-color: var(--mw-seal-disputed); --seal-glow: var(--mw-seal-disputed-glow); animation: mw-seal-pulse 2.2s ease-in-out infinite; }
.mw-seal[data-status="refunded"],
.mw-seal[data-status="resolved_buyer"],
.mw-seal[data-status="cancelled"] { --seal-color: var(--mw-seal-refunded); --seal-glow: var(--mw-seal-refunded-glow); }
@keyframes mw-seal-pulse {
	0%, 100% { box-shadow: 0 0 0 6px var(--seal-glow); }
	50% { box-shadow: 0 0 0 10px var(--seal-glow); }
}

.mw-seal-status-text { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.mw-seal-status-text[data-status="held"] { color: var(--mw-seal-held); }
.mw-seal-status-text[data-status="pending"] { color: var(--mw-seal-pending); }
.mw-seal-status-text[data-status="released"],
.mw-seal-status-text[data-status="resolved_seller"],
.mw-seal-status-text[data-status="resolved_split"] { color: var(--mw-seal-released); }
.mw-seal-status-text[data-status="disputed"] { color: var(--mw-seal-disputed); }
.mw-seal-status-text[data-status="refunded"],
.mw-seal-status-text[data-status="resolved_buyer"],
.mw-seal-status-text[data-status="cancelled"] { color: var(--mw-seal-refunded); }

/* ---- Wallet hero card ---- */
.mw-wallet-card {
	background: linear-gradient(160deg, var(--mw-surface-raised) 0%, var(--mw-surface) 100%);
	border: 1px solid var(--mw-border);
	border-radius: var(--mw-radius-lg);
	padding: 32px 36px;
	margin-bottom: 28px;
	position: relative;
	overflow: hidden;
}
.mw-wallet-card::before {
	content: '';
	position: absolute; top: -60%; right: -20%;
	width: 320px; height: 320px; border-radius: 50%;
	background: radial-gradient(circle, rgba(201,151,76,0.10), transparent 70%);
	pointer-events: none;
}
.mw-wallet-balance { font-family: var(--mw-font-mono); font-size: 44px; font-weight: 600; color: var(--mw-text); letter-spacing: -0.02em; }
.mw-wallet-currency { font-family: var(--mw-font-body); font-size: 16px; color: var(--mw-text-dim); margin-left: 10px; font-weight: 500; }

/* ---- Action cards (replace generic pill buttons on dashboard) ---- */
.mw-action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin: 24px 0; }
.mw-action-card {
	display: flex; flex-direction: column; gap: 10px;
	background: var(--mw-surface); border: 1px solid var(--mw-border);
	border-radius: var(--mw-radius); padding: 18px 20px;
	text-decoration: none; color: var(--mw-text);
	transition: border-color 0.2s ease, transform 0.15s ease;
}
.mw-action-card:hover { border-color: var(--mw-border-strong); transform: translateY(-2px); }
.mw-action-card svg { width: 22px; height: 22px; stroke: var(--mw-seal-held); }
.mw-action-card-label { font-family: var(--mw-font-display); font-size: 16px; font-weight: 600; }
.mw-action-card-desc { font-size: 14px; color: var(--mw-text-dim); }

.mw-btn {
	font-family: var(--mw-font-body); font-size: 16px; font-weight: 600;
	padding: 13px 22px; border-radius: 11px; border: 1px solid var(--mw-border-strong);
	background: var(--mw-surface-raised); color: var(--mw-text); cursor: pointer;
	transition: border-color 0.2s ease, background 0.2s ease;
}
.mw-btn:hover { border-color: var(--mw-seal-held); }
.mw-btn-primary { background: var(--mw-seal-held); color: #1a1204; border-color: var(--mw-seal-held); font-weight: 600; }
.mw-btn-primary:hover { background: #dba85a; }
.mw-btn-danger { background: transparent; color: var(--mw-seal-disputed); border-color: var(--mw-seal-disputed); }
.mw-btn-danger:hover { background: rgba(226,87,76,0.1); }
.mw-btn-sm { padding: 8px 14px; font-size: 14px; border-radius: 8px; }

/* ---- Case-file cards (escrow list) ---- */
.mw-case-list { display: flex; flex-direction: column; gap: 10px; }
.mw-case-card {
	display: flex; align-items: center; gap: 16px;
	background: var(--mw-surface); border: 1px solid var(--mw-border);
	border-radius: var(--mw-radius); padding: 18px 20px;
	text-decoration: none; color: var(--mw-text);
	transition: border-color 0.2s ease;
}
.mw-case-card:hover { border-color: var(--mw-border-strong); }
.mw-case-main { flex: 1; min-width: 0; }
.mw-case-ref { font-family: var(--mw-font-mono); font-size: 13px; color: var(--mw-text-dim); margin-bottom: 2px; }
.mw-case-title { font-family: var(--mw-font-display); font-size: 17px; font-weight: 600; }
.mw-case-amount { font-family: var(--mw-font-mono); font-size: 19px; font-weight: 600; text-align: right; }
.mw-case-status { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 110px; text-align: center; flex-shrink: 0; }
.mw-seal-status-text { line-height: 1.3; }

/* ---- Ledger table (dense, precise, monospace figures) ---- */
.mw-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.mw-table th, .mw-table td { padding: 13px 14px; border-bottom: 1px solid var(--mw-border); text-align: left; }
.mw-table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--mw-text-dim); font-weight: 600; }
.mw-table td.mw-mono { color: var(--mw-text); }
.mw-table tr:last-child td { border-bottom: none; }

.mw-badge { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; }
.mw-badge-pending { background: rgba(255,255,255,0.08); color: var(--mw-seal-pending); }
.mw-badge-held { background: var(--mw-seal-held-glow); color: var(--mw-seal-held); }
.mw-badge-released, .mw-badge-resolved_seller, .mw-badge-resolved_split, .mw-badge-completed, .mw-badge-paid { background: var(--mw-seal-released-glow); color: var(--mw-seal-released); }
.mw-badge-refunded, .mw-badge-resolved_buyer, .mw-badge-rejected, .mw-badge-cancelled { background: var(--mw-seal-refunded-glow); color: var(--mw-seal-refunded); }
.mw-badge-disputed { background: var(--mw-seal-disputed-glow); color: var(--mw-seal-disputed); }

/* ---- Forms ---- */
.mw-form-card {
	background: var(--mw-surface); border: 1px solid var(--mw-border);
	border-radius: var(--mw-radius-lg); padding: 32px; max-width: 480px;
}
.mw-form-field { margin-bottom: 18px; }
.mw-form-field label { display: block; font-size: 14px; color: var(--mw-text-dim); margin-bottom: 7px; font-weight: 500; }
.mw-form-field input, .mw-form-field select, .mw-form-field textarea {
	width: 100%; font-size: 16px; padding: 12px 14px; border-radius: 10px;
	border: 1px solid var(--mw-border-strong); background: var(--mw-ink); color: var(--mw-text);
	font-family: var(--mw-font-body); transition: border-color 0.2s ease;
}
.mw-form-field input:focus, .mw-form-field select:focus, .mw-form-field textarea:focus {
	outline: none; border-color: var(--mw-seal-held);
}
.mw-form-field input[type="number"], .mw-form-field input.mw-mono-input { font-family: var(--mw-font-mono); }

/* ---- Nav ---- */
.mw-nav { display: flex; gap: 4px; margin-bottom: 32px; border-bottom: 1px solid var(--mw-border); padding-bottom: 0; }
.mw-nav a { color: var(--mw-text-dim); text-decoration: none; font-size: 15px; font-weight: 500; padding: 10px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.mw-nav a.active { color: var(--mw-text); border-bottom-color: var(--mw-seal-held); }
.mw-nav a:hover:not(.active) { color: var(--mw-text); }

.mw-compliance-notice {
	background: var(--mw-seal-held-glow); border: 1px solid rgba(201,151,76,0.3);
	border-radius: var(--mw-radius); padding: 14px 18px; font-size: 15px; color: var(--mw-text);
	margin-bottom: 20px;
}

.mw-empty-state { color: var(--mw-text-dim); font-size: 16px; padding: 40px 20px; text-align: center; }
.mw-empty-state svg { width: 40px; height: 40px; stroke: var(--mw-text-dim); margin-bottom: 12px; opacity: 0.6; }

/* ---- Milestone timeline ---- */
.mw-timeline { display: flex; flex-direction: column; gap: 0; margin: 20px 0; }
.mw-timeline-item { display: flex; gap: 16px; padding-bottom: 22px; position: relative; }
.mw-timeline-item:not(:last-child)::before {
	content: ''; position: absolute; left: 14px; top: 32px; bottom: 0; width: 2px;
	background: var(--mw-border);
}
.mw-timeline-marker { flex-shrink: 0; z-index: 1; }
.mw-timeline-body { flex: 1; padding-top: 3px; }
.mw-timeline-title { font-family: var(--mw-font-display); font-weight: 600; font-size: 16px; }
.mw-timeline-amount { font-family: var(--mw-font-mono); font-size: 15px; color: var(--mw-text-dim); }

/* ---- Party breakdown (multi-party escrow) ---- */
.mw-party-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--mw-border); font-size: 15px; }
.mw-party-row:last-child { border-bottom: none; }
.mw-party-role { color: var(--mw-text-dim); font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }
.mw-party-share { font-family: var(--mw-font-mono); }

/* Responsive */
@media (max-width: 640px) {
	.mw-wallet-balance { font-size: 34px; }
	.mw-case-card { flex-wrap: wrap; }
	.mw-form-card { padding: 22px; }
}

