body { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif; font-size: 15px; line-height: 1.5; }
button, input, select { font-family: inherit; }
h1, h2, .nav-brand, .stat-card .stat-n, .stat-card .stat-l, .card h2, label, .tbl th, .badge { letter-spacing: 0; }
.license-link { font-family: inherit; }
dialog { box-sizing: border-box; width: min(480px, calc(100% - 28px)); padding: 24px; border: 1px solid #48646b; border-radius: 8px; background: #122131; color: #e2e8f0; box-shadow: 0 12px 40px #0008; }
dialog::backdrop { background: #020817b8; }
dialog h2 { margin-top: 0; font-size: 20px; }
dialog label { display: grid; gap: 8px; }
dialog input { width: 100%; }
dialog .toolbar { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin: 20px 0 0; }
dialog button { padding: 10px 14px; background: #254047; color: #e2e8f0; border: 1px solid #48646b; border-radius: 4px; }
#collection-confirm { background: #bce6dc; color: #12352b; }
#collection-error { color: #fb7185; }
#collection-status { color: #bce6dc; overflow-wrap: anywhere; }
button:disabled { opacity: .5; cursor: default; }
.brand-logo { display: block; width: 136px; height: 48px; object-fit: contain; }
.brand-link { display: inline-flex; flex-shrink: 0; }
.portal-footer { max-width: 1180px; margin: 24px auto 0; padding: 20px; border-top: 1px solid #293747; display: flex; justify-content: center; }
.login-brand .brand-logo { width: 230px; height: 82px; max-width: 100%; margin: 0 auto 24px; }
.login-brand { display: block; }
.login-page { min-height: 100vh; display: flex; flex-direction: column; }
.login-page main { box-sizing: border-box; width: 100%; margin: 8vh auto 24px; }
.login-page .portal-footer { margin-top: auto; width: 100%; box-sizing: border-box; }
.mobile-navigation, .mobile-account > summary { display: none; }
.mobile-account:not([open]) > summary { display: list-item; min-height: 44px; padding: 10px 12px; cursor: pointer; }
.mobile-account { min-width: 0; }
.terminal-context { display: none; }
.connection-badge { display: inline-block; font-size: 14px; font-weight: 600; line-height: 1.25; text-align: center; white-space: nowrap; }
.connection-badge:empty { display: none; }
.music-panel[hidden] { display: none; }
.music-download-toggle { display: flex; align-items: center; gap: 12px; padding: 12px 0; min-height: 44px; }
.music-download-toggle input { width: 20px; height: 20px; min-height: 20px; flex-shrink: 0; }
#disk-meter { display: block; width: 100%; max-width: 720px; height: 20px; margin-top: 16px; }
@media (max-width: 700px) {
	.mobile-navigation { display: grid; gap: 4px; min-width: 0; margin: 10px 0; }
	.mobile-navigation > span { color: #a8bbc6; font-size: 12px; text-transform: none; }
	.mobile-navigation select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #48646b; border-radius: 6px; background: #122131; color: #e2e8f0; appearance: auto; font-size: 16px; transform: none; }
	.mobile-navigation-secondary { background: #172b30; border: 1px solid #47646a; border-radius: 6px; padding: 10px; }
	.mobile-navigation-secondary select { background: #254047; }
	main > .mobile-navigation { position: sticky; top: 0; z-index: 30; background: #07111f; padding: 8px 0; margin: 0; border-bottom: 1px solid #293747; }
	main > .view > .mobile-navigation-secondary { position: sticky; top: 84px; z-index: 20; }
	.mobile-tab-source { display: none !important; }
	.mobile-account > summary { display: list-item; min-height: 44px; padding: 10px 12px; cursor: pointer; color: #a8bbc6; font-size: 14px; border: 1px solid #293747; border-radius: 6px; list-style: disclosure-closed inside; }
	.mobile-account[open] > summary { list-style-type: disclosure-open; }
	.mobile-account > summary::-webkit-details-marker { display: initial; }
	.mobile-account .account, .mobile-account .equipment-account { margin: 0; padding: 10px 12px; gap: 12px; }
	.mobile-account .account > span, .mobile-account .equipment-account > span { display: none; }
	.nav-inner { gap: 8px; padding: 8px 12px; }
	.nav-inner > .mobile-navigation { flex: 1; margin: 0; }
	.nav-inner > .mobile-account { flex-basis: 100%; }
	.brand-logo { width: 108px; height: 38px; }
	.wrap { padding: 16px 12px 30px; }
	header { padding: 12px; gap: 12px; }
	header h1 { font-size: 20px; }
	header > label { flex-basis: 100%; }
	.terminal-context { display: block; flex-basis: 100%; margin: 0; color: #a8bbc6; font-size: 14px; overflow-wrap: anywhere; }
	.terminal-context:empty { display: none; }
	#terminal { width: 100%; min-height: 44px; font-size: 16px; }
	main { padding: 12px; }
	.grid, .grid-2, .fields { grid-template-columns: minmax(0, 1fr); }
	.grid > *, .grid-2 > *, .fields > * { min-width: 0; }
	.card { padding: 16px; }
	.card h2, h2 { font-size: 19px; }
	.stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.stat-card { padding: 14px; border-radius: 8px; }
	.stat-card .stat-n { font-size: 30px; }
	.balances { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 12px 0; }
	.balance:first-child { grid-column: 1 / -1; }
	.balance strong { font-size: 20px; margin-top: 4px; overflow-wrap: anywhere; }
	.balance:first-child strong { font-size: 24px; }
	input, select { min-height: 44px; font-size: 16px; }
	select { appearance: auto; }
	button, .license-link, .page-btn { min-height: 44px; touch-action: manipulation; }
	.toolbar { gap: 8px; }
	.toolbar > label, .search-input { flex: 1 1 100%; width: 100%; max-width: none; min-width: 0; }
	.filter-chips { width: 100%; flex-wrap: nowrap; overflow-x: auto; padding: 2px 0 6px; }
	.filter-chips button { flex-shrink: 0; }
	.pagination, .pager { flex-wrap: wrap; gap: 6px; }
	.pagination { justify-content: flex-start; }
	.pager { justify-content: space-between; }
	.pagination .page-btn { min-width: 44px; border-radius: 6px; }
	.tbl-wrap, .table-wrap { max-width: 100%; }
	.mobile-records { display: block; width: 100%; }
	.mobile-records thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
	.mobile-records tbody { display: block; }
	.mobile-records tbody tr { display: block; padding: 12px; border-bottom: 1px solid #293747; }
	.mobile-records tbody td { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 10px; padding: 6px 0; border: 0; min-width: 0; text-align: left; overflow-wrap: anywhere; }
	.mobile-records td::before { content: attr(data-label); color: #a8bbc6; font-size: 12px; }
	.mobile-records td > * { min-width: 0; max-width: 100%; }
	.mobile-records .mobile-empty { display: block; padding: 14px 0; }
	.mobile-records .mobile-empty::before { content: none; }
	.mobile-records .row-actions { flex-wrap: wrap; white-space: normal; }
	.mobile-records .hw-id { max-width: 100%; white-space: normal; }
	.mobile-records .money { white-space: normal; }
	.results, .mini-pre { max-width: 100%; overflow-wrap: anywhere; }
	dialog { max-height: calc(100dvh - 24px); overflow-y: auto; padding: 18px; }
	dialog .toolbar button { flex: 1; }
	.portal-footer { padding: 16px; }
}