@font-face { font-family: "MM"; src: url("../assets/fonts/mm_500.ttf") format("truetype"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "MM"; src: url("../assets/fonts/mm_600.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "MM"; src: url("../assets/fonts/mm_700.ttf") format("truetype"); font-weight: 700 900; font-display: swap; }

:root {
	--blue: #0a5695;
	--panel: #052a4d;
	--island: #062847;
	--field: #031325;
	--pop: #0f3a66;
	--float: #1b5589;
	--ink: #062444;
	--knob: #0b4a82;
	--text: #fff;
	--sub: #a9cceA;
	--mute: #6e97c0;
	--slate: #52708f;
	--red: #e3301f;
	--good: #1f9d55;
	--warn: #e08a00;
	--info: #1479c2;
	--spring: cubic-bezier(.34, 1.56, .64, 1);
	--out: cubic-bezier(.22, 1, .36, 1);
	--bgfilter: none;
	--spin: 16s;
}

html[data-theme="midnight"] { --bgfilter: hue-rotate(-28deg) brightness(.62) saturate(.9); --blue: #06284a; }
html[data-theme="strawberry"] { --bgfilter: hue-rotate(135deg) saturate(1.05) brightness(.95); --blue: #8a2f6b; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
	font-family: "MM", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 13px;
	color: var(--text);
	background: radial-gradient(900px 600px at 50% 40%, #0b3b6b 0%, #051d38 55%, #030e1d 100%);
	overflow: hidden;
	-webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; padding: 0; }
svg { display: block; }
.ico svg, [data-icon] svg { width: 100%; height: 100%; }
[data-icon] { display: inline-block; width: 17px; height: 17px; flex: none; }

.stage { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; }

.window {
	position: relative;
	width: min(940px, 100%);
	height: min(620px, 100%);
	border-radius: 14px;
	overflow: hidden;
	background: var(--blue);
	box-shadow: 0 40px 90px rgba(0, 0, 0, .55);
	will-change: transform, opacity;
}
.window.hidden { display: none; }
.bg { position: absolute; inset: 0; background: url("../assets/bg.png") center / 100% 100% no-repeat; filter: var(--bgfilter); transition: filter .6s var(--out); }

.top { position: absolute; left: 0; right: 0; top: 0; height: 72px; display: flex; align-items: center; padding: 0 22px; cursor: grab; user-select: none; }
.top.dragging { cursor: grabbing; }
.logo { height: 50px; width: auto; transform-origin: left center; animation: pop .7s var(--spring) .15s both; }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }

.search {
	position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
	width: 230px; height: 32px; border-radius: 16px; background: rgba(5, 42, 77, .5);
	display: flex; align-items: center; padding: 0 12px 0 13px; gap: 9px; cursor: text;
	transition: width .45s var(--spring), background .2s;
}
.search:focus-within { width: 280px; background: rgba(5, 42, 77, .75); }
.search .ico { width: 14px; height: 14px; color: var(--sub); transition: color .2s; }
.search:focus-within .ico { color: #fff; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 12px; font-weight: 500; }
.search input::placeholder { color: var(--sub); }
.clear { width: 12px; height: 12px; color: var(--sub); opacity: 0; pointer-events: none; transition: opacity .15s, color .15s; }
.clear [data-icon] { width: 12px; height: 12px; }
.clear.show { opacity: 1; pointer-events: auto; }
.clear:hover { color: #fff; }

.controls { margin-left: auto; display: flex; gap: 16px; align-items: center; }
.controls button { color: var(--sub); transition: color .15s, transform .15s; }
.controls button:hover { color: #fff; }
.controls button.danger:hover { color: #ff6b5b; }
.controls button:active { transform: scale(.85); }

.panel {
	position: absolute; left: 14px; top: 86px; bottom: 14px; width: 172px;
	border-radius: 14px; background: rgba(5, 42, 77, .55);
}
nav { position: relative; padding: 8px; }
.indicator { position: absolute; left: 8px; right: 8px; top: 0; height: 34px; border-radius: 10px; background: #fff; transform: translateY(8px); transition: transform .5s var(--spring); }
.section { height: 28px; display: flex; align-items: flex-end; padding: 0 10px 5px; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); position: relative; }
.tab { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; margin-bottom: 3px; padding: 0 12px; border-radius: 10px; color: var(--sub); font-weight: 600; text-align: left; transition: color .2s, background .2s, padding .2s var(--out), transform .1s; }
.tab b { font-weight: 600; font-size: 13px; }
.tab:hover { color: #fff; background: rgba(255, 255, 255, .08); padding-left: 14px; }
.tab:active { transform: scale(.97); }
.tab.active, .tab.active:hover { color: var(--ink); background: none; padding-left: 14px; }

.chip { position: absolute; left: 8px; right: 8px; bottom: 8px; height: 46px; border-radius: 12px; background: rgba(6, 40, 71, .65); display: flex; align-items: center; gap: 8px; padding: 0 8px; }
.chip img { width: 30px; height: 30px; border-radius: 50%; background: var(--pop); }
.chip strong { display: block; font-size: 12px; font-weight: 600; }
.chip span { display: block; font-size: 10px; color: var(--sub); font-weight: 500; }
.online { position: absolute; left: 34px; bottom: 9px; width: 9px; height: 9px; border-radius: 50%; background: #4ade80; }

.pages { position: absolute; left: 200px; right: 0; top: 72px; bottom: 26px; overflow-y: auto; overflow-x: hidden; padding: 14px 18px 14px 0; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .35) transparent; }
.page { display: none; }
.page.active { display: block; animation: rise .45s var(--out); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.grid.one { grid-template-columns: minmax(0, 1fr); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.card { background: rgba(6, 40, 71, .72); border-radius: 12px; padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 7px; transition: transform .25s var(--out); }
.card.link { cursor: pointer; }
.card.link:hover { transform: translateY(-2px); }
.card.hide { display: none; }
.card h3 { margin: 0; height: 22px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sub); }
.card h3 .ico { width: 15px; height: 15px; color: var(--sub); }
.card p { margin: 0; color: var(--sub); line-height: 1.55; font-weight: 500; }
.card strong.t { font-size: 15px; font-weight: 700; }
.status { font-size: 10px; font-weight: 600; letter-spacing: .04em; color: var(--sub); background: rgba(255, 255, 255, .1); padding: 2px 8px; border-radius: 6px; text-transform: none; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.tag { font-size: 11px; font-weight: 600; color: var(--sub); background: rgba(255, 255, 255, .09); padding: 2px 8px; border-radius: 6px; }

pre { margin: 4px 0 0; padding: 12px; border-radius: 8px; background: rgba(3, 19, 37, .7); font: 12px/1.55 ui-monospace, "Cascadia Code", Consolas, monospace; color: #cfe5fa; overflow-x: auto; tab-size: 4; scrollbar-width: thin; }

.btn { height: 30px; padding: 0 14px; border-radius: 8px; background: var(--pop); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: background .15s, transform .1s var(--out); }
.btn:hover { background: #185089; }
.btn:active { transform: scale(.97); }
.btn.primary { background: #fff; color: var(--ink); }
.btn.primary:hover { background: #e4f1fd; }
.btn [data-icon] { width: 13px; height: 13px; }
.btn.block { width: 100%; height: 34px; }
.card .btn { align-self: flex-start; }

.row { min-height: 28px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--sub); font-weight: 500; font-size: 13px; cursor: pointer; user-select: none; transition: color .2s; }
.row:hover { color: #fff; }
.row.on { color: #fff; }
.switch { width: 34px; height: 18px; border-radius: 9px; background: rgba(255, 255, 255, .14); position: relative; flex: none; transition: background .2s; }
.switch i { position: absolute; left: 3px; top: 3px; width: 12px; height: 12px; border-radius: 6px; background: var(--sub); transition: transform .42s var(--spring), background .2s, width .3s var(--spring); }
.row:hover .switch:not(.on) { background: rgba(255, 255, 255, .24); }
.row:hover .switch i { width: 15px; }
.switch.on { background: #fff; }
.switch.on i { transform: translateX(16px); background: var(--knob); }
.row:hover .switch.on i { transform: translateX(13px); }

.field-label { color: var(--sub); font-weight: 500; font-size: 13px; margin-top: 2px; }
.select { height: 30px; border-radius: 8px; background: rgba(3, 19, 37, .65); display: flex; align-items: center; justify-content: space-between; padding: 0 12px; font-size: 12px; font-weight: 600; transition: background .15s, transform .1s; }
.select:hover { background: rgba(3, 19, 37, .85); }
.select:active { transform: scale(.98); }
.select [data-icon] { width: 14px; height: 14px; color: var(--sub); transition: transform .3s var(--out); }
.select.open [data-icon] { transform: rotate(180deg); }

.slider { padding-top: 2px; }
.slider .head { display: flex; justify-content: space-between; color: var(--sub); font-weight: 500; font-size: 13px; transition: opacity .2s; }
.slider .head b { color: #fff; font-weight: 600; font-size: 12px; transition: opacity .2s; }
.slider.active .head b { opacity: .5; }
.hit { position: relative; height: 22px; cursor: pointer; touch-action: none; }
.track { position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 3px; background: rgba(255, 255, 255, .14); transition: height .2s, margin .2s, background .2s; }
.slider.active .track { height: 6px; margin-top: -3px; background: rgba(255, 255, 255, .2); }
.fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 3px; background: linear-gradient(90deg, var(--sub), #fff); }
.thumb { position: absolute; right: 0; top: 50%; width: 12px; height: 12px; margin: -6px -6px 0 0; border-radius: 50%; background: #fff; transition: width .3s var(--spring), height .3s var(--spring), margin .3s var(--spring); }
.slider.active .thumb { width: 16px; height: 16px; margin: -8px -8px 0 0; }
.tip { position: absolute; left: 50%; bottom: 100%; margin-bottom: 14px; transform: translateX(-50%) scale(.6); transform-origin: 50% 100%; background: #fff; color: var(--ink); font-size: 12px; font-weight: 700; height: 22px; padding: 0 9px; border-radius: 7px; display: grid; place-items: center; opacity: 0; transition: transform .34s var(--spring), opacity .16s; pointer-events: none; white-space: nowrap; }
.tip::after { content: ""; position: absolute; left: 50%; bottom: -3px; width: 8px; height: 8px; margin-left: -4px; background: #fff; border-radius: 2px; transform: rotate(45deg); z-index: -1; }
.slider.active .tip { opacity: 1; transform: translateX(-50%) scale(1); }

.popup { position: fixed; z-index: 50; min-width: 160px; padding: 4px; border-radius: 12px; background: var(--float); box-shadow: 0 16px 40px rgba(0, 0, 0, .35); opacity: 0; transform: translateY(8px) scale(.94); transform-origin: 50% 0; pointer-events: none; transition: opacity .16s, transform .3s var(--spring); }
.popup.show { opacity: 1; transform: none; pointer-events: auto; }
.opt { height: 30px; border-radius: 8px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; color: var(--sub); font-size: 12px; font-weight: 500; cursor: pointer; opacity: 0; transform: translateY(6px); transition: background .15s, color .15s, padding .2s var(--out); }
.popup.show .opt { opacity: 1; transform: none; transition: opacity .28s var(--out) calc(var(--i) * 30ms), transform .28s var(--out) calc(var(--i) * 30ms), background .15s, color .15s, padding .2s var(--out); }
.opt:hover { background: rgba(255, 255, 255, .1); color: #fff; padding-left: 16px; }
.opt.sel { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 700; }
.opt [data-icon] { width: 12px; height: 12px; }

.foot { position: absolute; left: 200px; right: 18px; bottom: 10px; height: 14px; display: flex; justify-content: space-between; font-size: 10px; font-weight: 500; color: var(--sub); opacity: .6; }

.toasts { position: fixed; right: 24px; bottom: 24px; width: 312px; display: flex; flex-direction: column; gap: 10px; z-index: 60; pointer-events: none; }
.toast { position: relative; overflow: hidden; color: #fff; border-radius: 18px; padding: 14px 16px 20px 14px; display: flex; gap: 13px; align-items: flex-start; pointer-events: auto; cursor: pointer;
	background: linear-gradient(180deg, rgba(16, 78, 138, .94), rgba(6, 40, 76, .96));
	-webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 18px 40px -10px rgba(0, 0, 0, .55);
	animation: toast-in .6s var(--spring) both; transition: transform .2s var(--out); }
.toast:hover { transform: translateX(-4px); }
.toast.out { animation: toast-out .3s cubic-bezier(.5, 0, .75, 0) both; }
@keyframes toast-in { from { transform: translateY(24px) scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-out { to { transform: translateX(60px) scale(.96); opacity: 0; } }
.toast img { width: 36px; height: 36px; animation: swirl-in .9s var(--out) both; flex: none; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .3)); }
@keyframes swirl-in { from { transform: rotate(-160deg) scale(.6); } to { transform: none; } }
.toast .tx { flex: 1; min-width: 0; padding: 1px 30px 0 0; }
.toast b { display: block; font-size: 13.5px; font-weight: 700; letter-spacing: -.005em; }
.toast span.m { display: block; margin-top: 3px; font-size: 12px; font-weight: 500; color: var(--sub); line-height: 1.4; }
.toast .kind { position: absolute; right: 12px; top: 12px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .1); }
.toast .kind svg { width: 14px; height: 14px; }
.toast .life { position: absolute; left: 14px; right: 14px; bottom: 9px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.toast .life i { display: block; height: 100%; background: linear-gradient(90deg, #7cc4ff, #fff); border-radius: 2px; transform-origin: left; animation: life linear both; }
@keyframes life { to { transform: scaleX(0); } }

.bubble { position: fixed; z-index: 40; display: none; width: 60px; height: 60px; transform-origin: 30px 30px; touch-action: none; }
.bubble.show { display: block; animation: bubble-in .55s var(--spring) both; }
@keyframes bubble-in { from { transform: scale(0); } to { transform: scale(1); } }
.bubble .pill { position: absolute; left: 0; top: 0; height: 60px; width: 60px; border-radius: 30px; background: rgba(5, 42, 77, .95); display: flex; align-items: center; overflow: hidden; transition: width .5s var(--spring); box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
.bubble:hover .pill, .bubble:focus-visible .pill { width: 180px; }
.bubble img { width: 48px; height: 48px; margin-left: 6px; flex: none; animation: spin var(--spin) linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bubble em { margin-left: 12px; font-style: normal; font-weight: 600; font-size: 13px; white-space: nowrap; opacity: 0; transition: opacity .25s; }
.bubble:hover em { opacity: 1; }

@media (max-width: 760px) {
	.stage { padding: 0; }
	.window { width: 100%; height: 100%; border-radius: 0; }
	.search { display: none; }
	.logo { height: 42px; }
	.panel { left: 0; right: 0; top: 72px; bottom: auto; width: auto; height: 52px; border-radius: 0; }
	nav { display: flex; gap: 4px; padding: 9px 12px; overflow-x: auto; scrollbar-width: none; }
	.section, .chip, .indicator { display: none; }
	.tab { width: auto; margin: 0; flex: none; }
	.tab.active, .tab.active:hover { background: #fff; }
	.pages { left: 0; top: 124px; padding: 14px; }
	.foot { left: 14px; }
	.grid, .grid.three { grid-template-columns: minmax(0, 1fr); }
	.toasts { left: 12px; right: 12px; width: auto; bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
html.reduce *, html.reduce *::before, html.reduce *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
