@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root { color-scheme: light dark; --ink: #f2f4ef; --muted: #9ba5a4; --page: #101313; --panel: #191e1d; --panel-2: #202725; --line: rgba(227, 237, 228, .11); --teal: #67e1c3; --yellow: #f2c96b; --coral: #fa8c73; --blue: #8eafea; --lime: #b7dc6f; --shadow: 0 18px 55px rgba(0, 0, 0, .25); }
@media (prefers-color-scheme: light) {
	:root { --ink: #18201f; --muted: #64716e; --page: #eef3ef; --panel: #ffffff; --panel-2: #f2f6f3; --line: rgba(24, 47, 42, .14); --shadow: 0 18px 55px rgba(39, 67, 60, .10); }
	body { background: radial-gradient(circle at 78% -10%, rgba(49, 176, 149, .13), transparent 30rem), radial-gradient(circle at -10% 70%, rgba(103, 135, 205, .10), transparent 32rem), var(--page); }
	.dialog-card { background: #ffffff; }
	.toast { background: #e3f6ef; }
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 78% -10%, rgba(103, 225, 195, .10), transparent 30rem), radial-gradient(circle at -10% 70%, rgba(142, 175, 234, .07), transparent 32rem), var(--page); color: var(--ink); font: 400 15px/1.5 'Space Grotesk', 'Trebuchet MS', sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0 34px; }
.topbar, .hero-row, .section-heading, .footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.topbar { border-bottom: 1px solid var(--line); padding-bottom: 24px; }
.brand-lockup { display: flex; align-items: center; gap: 13px; }
.brand-mark { width: 35px; height: 35px; display: flex; align-items: end; justify-content: center; gap: 3px; border-radius: 10px; background: var(--teal); padding: 8px; }
.brand-mark span { display: block; width: 4px; border-radius: 3px; background: #102321; }.brand-mark span:nth-child(1) { height: 8px; }.brand-mark span:nth-child(2) { height: 14px; }.brand-mark span:nth-child(3) { height: 19px; }
.eyebrow { margin: 0 0 4px; color: var(--muted); font: 500 10px/1.2 'DM Mono', monospace; letter-spacing: .13em; }.brand-lockup h1 { margin: 0; font-size: 20px; letter-spacing: -.04em; }
.connection-status { display: flex; align-items: center; gap: 8px; margin-left: auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 12px; }.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #77817f; }.connection-status[data-state="online"] .status-dot { background: var(--teal); box-shadow: 0 0 0 4px rgba(103,225,195,.12); }.connection-status[data-state="error"] .status-dot { background: var(--coral); }.icon-button { border: 0; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; padding: 6px; transform: rotate(90deg); }.icon-button:hover, .text-button:hover { color: var(--teal); }
.hero-row { padding: 52px 0 30px; align-items: end; }.hero-row h2 { margin: 0; font-size: clamp(30px, 5vw, 52px); line-height: 1; letter-spacing: -.065em; font-weight: 600; }.subtle { color: var(--muted); margin: 8px 0 0; font-size: 13px; }.button { border: 0; border-radius: 8px; padding: 11px 15px; color: #13201e; font-weight: 600; transition: transform .18s ease, filter .18s ease, background .18s ease; }.button:hover { filter: brightness(1.08); transform: translateY(-1px); }.button:disabled { cursor: wait; opacity: .55; transform: none; }.button-secondary { border: 1px solid var(--line); color: var(--ink); background: var(--panel); }.button-primary { background: var(--teal); }.button-on { background: var(--teal); min-width: 104px; }.button-off { background: var(--panel-2); color: var(--ink); min-width: 104px; }.text-button { color: var(--teal); background: transparent; border: 0; padding: 4px 0; font-size: 12px; }
.alert { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; padding: 13px 16px; border: 1px solid rgba(250, 140, 115, .36); border-radius: 9px; background: rgba(250, 140, 115, .08); }.alert-icon { display: grid; width: 23px; height: 23px; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--coral); color: #301a16; font-weight: 700; }.alert strong { font-size: 13px; }.alert p { margin: 1px 0 0; color: #d4a69c; font-size: 12px; }.alert-close { margin-left: auto; border: 0; background: transparent; color: var(--muted); font-size: 22px; }
.metrics-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }.metric-card, .panel { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(255,255,255,.035), transparent 70%), var(--panel); box-shadow: var(--shadow); }.metric-card { position: relative; min-height: 148px; overflow: hidden; padding: 19px; border-radius: 10px; }.metric-card:hover { border-color: rgba(103,225,195,.3); }.metric-icon { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 8px; font: 500 11px 'DM Mono', monospace; }.teal { background: rgba(103,225,195,.15); color: var(--teal); }.yellow { background: rgba(242,201,107,.15); color: var(--yellow); }.coral { background: rgba(250,140,115,.15); color: var(--coral); }.blue { background: rgba(142,175,234,.15); color: var(--blue); }.lime { background: rgba(183,220,111,.15); color: var(--lime); }.metric-copy { position: absolute; bottom: 17px; left: 19px; }.metric-copy p { margin: 0 0 2px; color: var(--muted); font-size: 12px; }.metric-copy strong { margin-right: 5px; font: 500 26px 'DM Mono', monospace; letter-spacing: -.08em; }.metric-copy span { color: #74807e; font-size: 10px; }.metric-accent { position: absolute; bottom: -30px; right: -15px; width: 90px; height: 90px; border: 1px solid rgba(103,225,195,.25); border-radius: 50%; }.metric-accent:after { content: ''; position: absolute; inset: 12px; border: 1px solid rgba(103,225,195,.2); border-radius: 50%; }
.panel { border-radius: 10px; }.status-panel { margin-top: 12px; padding: 24px; }.section-heading h2 { margin: 0; font-size: 19px; letter-spacing: -.04em; }.live-pill { display: flex; align-items: center; gap: 7px; color: var(--teal); font: 500 11px 'DM Mono', monospace; }.live-pill span { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }.status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 22px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }.status-item { display: flex; align-items: center; gap: 13px; padding: 17px; background: var(--panel); }.status-symbol { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 8px; background: rgba(103,225,195,.1); color: var(--teal); font-size: 18px; }.status-symbol.warning { color: var(--coral); background: rgba(250,140,115,.13); }.status-item p { margin: 0; color: var(--muted); font-size: 11px; }.status-item strong { font-size: 14px; }
.control-layout { display: grid; grid-template-columns: 1.08fr .92fr; gap: 12px; margin-top: 12px; }.control-panel, .settings-panel { padding: 24px; }.relay-control { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 25px 0 20px; }.control-label, .recharge-form label, .threshold-form label { margin: 0; font-size: 13px; font-weight: 600; }.relay-buttons { display: flex; gap: 7px; }.divider { height: 1px; background: var(--line); }.recharge-form { padding-top: 20px; }.input-action { display: flex; align-items: center; margin-top: 9px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel-2); }.input-prefix { padding-left: 13px; color: var(--muted); }.input-action input { min-width: 0; flex: 1; border: 0; background: transparent; color: var(--ink); padding: 12px 8px; outline: 0; }.input-action .button { border-radius: 0; }.form-note { margin: 7px 0 0; color: var(--muted); font-size: 11px; }.threshold-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px 12px; margin-top: 24px; }.field-with-unit { display: flex; align-items: center; margin-top: 6px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); }.field-with-unit input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; padding: 9px 10px; }.field-with-unit span { padding-right: 10px; color: var(--muted); font: 10px 'DM Mono', monospace; white-space: nowrap; }.full-field { grid-column: 1 / -1; }.footer { margin-top: 18px; color: #68716f; font-size: 11px; }
.connection-dialog { width: min(430px, calc(100% - 30px)); padding: 0; border: 0; color: var(--ink); background: transparent; }.connection-dialog::backdrop { background: rgba(4, 7, 7, .82); backdrop-filter: blur(8px); }.dialog-card { display: flex; flex-direction: column; gap: 8px; padding: 29px; border: 1px solid var(--line); border-radius: 12px; background: #1a201f; box-shadow: var(--shadow); }.dialog-mark { display: grid; width: 40px; height: 40px; place-items: center; margin-bottom: 4px; border-radius: 10px; background: var(--teal); color: #102321; font-size: 28px; }.dialog-card h2 { margin: 0; font-size: 27px; letter-spacing: -.06em; }.dialog-card .subtle { margin: 2px 0 13px; line-height: 1.55; }.dialog-card label { margin-top: 6px; color: var(--muted); font-size: 12px; }.dialog-card input { border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); color: var(--ink); padding: 11px 12px; outline: 0; }.dialog-submit { display: flex; align-items: center; justify-content: space-between; margin-top: 13px; }.dialog-error { margin: 3px 0 0; color: var(--coral); font-size: 12px; }.toast { position: fixed; right: 20px; bottom: 20px; z-index: 5; max-width: calc(100% - 40px); padding: 11px 15px; border: 1px solid rgba(103,225,195,.3); border-radius: 8px; background: #1c2926; color: var(--teal); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .2s, transform .2s; }.toast.visible { opacity: 1; transform: translateY(0); }
@media (max-width: 900px) { .metrics-grid { grid-template-columns: repeat(3, 1fr); }.balance-card { grid-column: span 2; }.control-layout { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .shell { width: min(100% - 26px, 520px); padding-top: 18px; }.topbar { padding-bottom: 18px; }.connection-status { margin-left: auto; }.connection-status span:last-child { display: none; }.hero-row { align-items: start; flex-direction: column; gap: 18px; padding: 36px 0 22px; }.hero-row h2 { font-size: 35px; max-width: 350px; }.hero-row .button { align-self: stretch; }.metrics-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }.metric-card { min-height: 137px; padding: 15px; }.metric-copy { left: 15px; bottom: 14px; }.metric-copy strong { font-size: 22px; }.balance-card { grid-column: span 2; }.status-panel, .control-panel, .settings-panel { padding: 18px; }.status-grid { grid-template-columns: 1fr; }.status-item { padding: 13px; }.relay-control { align-items: start; flex-direction: column; }.relay-buttons { width: 100%; }.relay-buttons .button { flex: 1; }.input-action .button { padding-inline: 12px; }.footer { align-items: flex-start; flex-direction: column; gap: 8px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
[hidden] { display: none !important; }

/* Product surface: calm contrast, clear hierarchy, and theme tokens. */
:root {
	--brand: #19b88a;
	--brand-strong: #087b5c;
	--brand-soft: rgba(25, 184, 138, .12);
	--danger: #d94b4b;
	--warning: #b7791f;
	--page: #f4f7f5;
	--panel: #ffffff;
	--panel-2: #f0f5f2;
	--ink: #14201c;
	--muted: #61706a;
	--line: #dce7e1;
	--shadow: 0 16px 40px rgba(19, 53, 42, .08);
	--radius: 14px;
}
[data-theme="dark"] {
	--page: #101816;
	--panel: #18221f;
	--panel-2: #202c28;
	--ink: #f1f7f3;
	--muted: #9eafa8;
	--line: rgba(220, 239, 228, .13);
	--shadow: 0 18px 50px rgba(0, 0, 0, .24);
}
body { background: radial-gradient(circle at 85% -10%, rgba(25, 184, 138, .12), transparent 34rem), radial-gradient(circle at -10% 55%, rgba(70, 125, 180, .08), transparent 30rem), var(--page); color: var(--ink); transition: background .2s ease, color .2s ease; }
.shell { width: min(1240px, calc(100% - 48px)); padding-top: 22px; }
.topbar { position: sticky; top: 0; z-index: 4; padding: 12px 0 18px; background: color-mix(in srgb, var(--page) 90%, transparent); backdrop-filter: blur(14px); }
.brand-mark { background: var(--brand); }.connection-status { border-color: var(--line); }.connection-status[data-state="online"] .status-dot, .live-pill span { background: var(--brand); }.connection-status[data-state="online"] .status-dot { box-shadow: 0 0 0 4px var(--brand-soft); }.header-relay { display: flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font: 11px 'DM Mono', monospace; }.header-relay-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }.header-relay[data-state="on"] { color: var(--brand-strong); }.header-relay[data-state="on"] .header-relay-dot { background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }.header-relay[data-state="off"] .header-relay-dot { background: var(--danger); }.theme-toggle { margin-left: 4px; }
.hero-row { padding: 52px 0 28px; }.hero-row h2 { max-width: 640px; font-size: clamp(36px, 5vw, 58px); letter-spacing: -.07em; }.hero-row .subtle { font-size: 14px; }
.button { border-radius: 9px; min-height: 42px; }.button-primary, .button-on { background: var(--brand); color: #052b20; }.button-secondary, .button-off { background: var(--panel); color: var(--ink); border-color: var(--line); }.button-danger { background: var(--danger); color: #fff; }.button:active { transform: translateY(1px); }.button:disabled { cursor: progress; }
.alert { border-color: color-mix(in srgb, var(--danger) 42%, transparent); background: color-mix(in srgb, var(--danger) 9%, var(--panel)); }.alert p { color: var(--muted); }
.metrics-grid { grid-template-columns: 1.3fr repeat(4, 1fr); gap: 14px; }.metric-card, .panel { border-radius: var(--radius); border-color: var(--line); background: var(--panel); box-shadow: var(--shadow); }.metric-card { min-height: 154px; padding: 20px; transition: border-color .2s ease, transform .2s ease; }.metric-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }.metric-card.balance-card { order: -1; grid-column: span 1; background: linear-gradient(145deg, color-mix(in srgb, var(--brand) 17%, var(--panel)), var(--panel) 70%); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }.metric-card.balance-card .metric-copy strong { font-size: 34px; color: var(--brand-strong); }.metric-icon { border-radius: 10px; }.metric-copy { bottom: 18px; }.metric-copy strong { color: var(--ink); font-size: 28px; letter-spacing: -.07em; }.metric-copy span { color: var(--muted); }
.trend-panel { margin-top: 14px; padding: 22px 24px 17px; }.trend-range { color: var(--muted); font: 11px 'DM Mono', monospace; }.trend-summary { display: flex; align-items: baseline; gap: 10px; margin: 22px 0 10px; }.trend-summary strong { font: 500 25px 'DM Mono', monospace; letter-spacing: -.06em; }.trend-summary span { color: var(--muted); font-size: 12px; }.chart-wrap { overflow: hidden; }.trend-chart { display: block; width: 100%; height: 150px; }.chart-line { fill: none; stroke: var(--brand); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }.chart-area { fill: url(#chartFill); }.chart-axis { display: flex; justify-content: space-between; color: var(--muted); font: 10px 'DM Mono', monospace; }
.status-panel { margin-top: 14px; padding: 24px; }.status-grid { margin-top: 20px; border-radius: 10px; }.status-symbol { background: var(--brand-soft); color: var(--brand-strong); }.status-symbol.warning { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); animation: alert-pulse 1.8s ease-in-out infinite; }.status-item strong { color: var(--ink); }.status-item[data-state="on"] .status-symbol { background: var(--brand); color: #062c21; }
.control-layout { margin-top: 14px; gap: 14px; }.control-layout > *, .settings-panel, .threshold-form { min-width: 0; }.control-panel, .settings-panel { padding: 24px; }.field-with-unit, .input-action { border-color: var(--line); background: var(--panel-2); }.field-with-unit:focus-within, .input-action:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }.field-with-unit input, .input-action input { color: var(--ink); }.footer { color: var(--muted); }
.connection-dialog, .confirmation-dialog { color: var(--ink); }.dialog-card { border-color: var(--line); border-radius: var(--radius); background: var(--panel); }.dialog-mark { background: var(--brand); color: #062c21; }.danger-mark { background: color-mix(in srgb, var(--danger) 15%, var(--panel)); color: var(--danger); }.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }.dialog-actions .button { min-width: 90px; }.toast { background: var(--panel); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); color: var(--brand-strong); box-shadow: var(--shadow); }
body[data-loading="true"] .metric-copy strong, body[data-loading="true"] .status-item strong, body[data-loading="true"] #trendCurrent { color: transparent; min-width: 54px; border-radius: 5px; background: linear-gradient(90deg, var(--panel-2), color-mix(in srgb, var(--panel-2) 60%, var(--brand)), var(--panel-2)); background-size: 200% 100%; animation: skeleton 1.2s ease-in-out infinite; }
@keyframes skeleton { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@keyframes alert-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 0%, transparent); } 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--danger) 12%, transparent); } }
@media (max-width: 900px) { .metrics-grid { grid-template-columns: repeat(3, 1fr); }.metric-card.balance-card { grid-column: span 1; } }
@media (max-width: 600px) { .shell { width: min(calc(100% - 28px), 520px); }.topbar { padding-top: 8px; }.connection-status span:last-child, .header-relay { display: none; }.hero-row { padding-top: 38px; }.metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }.threshold-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }.metric-card.balance-card { grid-column: span 2; }.metric-card.balance-card .metric-copy strong { font-size: 30px; }.trend-panel { padding: 18px; }.trend-chart { height: 125px; }.trend-summary { margin-top: 18px; } }
@media (prefers-reduced-motion: reduce) { .status-symbol.warning, body[data-loading="true"] .metric-copy strong, body[data-loading="true"] .status-item strong { animation: none; } }
