:root {
  --mv-bg: #06111f;
  --mv-panel: #08192b;
  --mv-text: #eef6ff;
  --mv-muted: #8ea7c2;
  --mv-accent: #3295f5;
  --mv-border: rgba(86, 157, 224, .24);
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background:
    radial-gradient(circle at 50% -20%, rgba(39, 110, 175, .22), transparent 45%),
    var(--mv-bg);
  color: var(--mv-text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: 100%;
  height: calc(100% - 72px);
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.view {
  width: 100%;
  height: 100%;
}

.portal {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.portal-hero {
  max-width: 760px;
  padding: 48px 0 28px;
}

.eyebrow {
  color: #62b0fb;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
}

.portal-hero h1 {
  margin: 9px 0 10px;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.05;
}

.portal-hero p {
  margin: 0;
  color: var(--mv-muted);
  font-size: 14px;
  line-height: 1.7;
}

.module-grid {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.module-card {
  display: flex;
  gap: 19px;
  min-height: 215px;
  padding: 24px;
  border: 1px solid var(--mv-border);
  border-radius: 19px;
  background: linear-gradient(145deg, rgba(12,38,65,.97), rgba(5,19,34,.97));
  box-shadow: 0 22px 60px rgba(0,0,0,.28);
  transition: transform .2s ease, border-color .2s ease;
}

.module-card:hover:not(.is-disabled) {
  transform: translateY(-3px);
  border-color: rgba(86,157,224,.55);
}

.module-card.is-disabled {
  opacity: .55;
}

.module-icon {
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 16px;
  background: rgba(255,255,255,.055);
  font-size: 29px;
}

.module-content {
  min-width: 0;
}

.module-status {
  color: #70b6f9;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.module-card h2 {
  margin: 8px 0;
  font-size: 22px;
}

.module-card p {
  min-height: 44px;
  margin: 0 0 18px;
  color: var(--mv-muted);
  font-size: 12px;
  line-height: 1.6;
}

.module-button {
  padding: 9px 13px;
  border: 1px solid rgba(80,164,247,.55);
  border-radius: 9px;
  background: rgba(59,154,245,.13);
  color: #cfe8ff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.module-button:hover:not(:disabled),
.module-button.active {
  background: var(--mv-accent);
  color: white;
}

.module-button:disabled {
  cursor: not-allowed;
}

.module-view {
  position: relative;
  background: #020814;
}

.module-host {
  width: 100%;
  height: 100%;
  position: relative;
}

.module-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: none;
  background: #020814;
}

.module-frame.active {
  display: block;
}

.module-loading {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #b8d7f2;
  background: rgba(2,8,20,.96);
}

.module-loading[hidden] {
  display: none;
}

.loader-ring {
  width: 23px;
  height: 23px;
  border: 3px solid rgba(94,170,240,.22);
  border-top-color: #4da6fa;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.mv-dialog {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.62);
  backdrop-filter: blur(5px);
}

.mv-dialog.open {
  display: flex;
}

.mv-dialog-card {
  width: min(430px, calc(100% - 32px));
  padding: 22px;
  border: 1px solid rgba(91,157,224,.35);
  border-radius: 16px;
  background: #08192b;
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
  position: relative;
}

.mv-dialog-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  color: #91abc5;
  font-size: 25px;
  cursor: pointer;
}

.mv-dialog-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 10px;
}

.mv-dialog-message {
  margin: 0;
  color: #9eb5ca;
  font-size: 13px;
  line-height: 1.7;
}

@media (max-width: 800px) {
  .shell { overflow: auto; -webkit-overflow-scrolling: touch; }
  .portal { width: calc(100% - 24px); padding-bottom: 28px; }
  .module-grid {
    grid-template-columns: 1fr;
    width: calc(100% - 24px);
  }

  .portal-hero {
    padding: 26px 0 18px;
  }
  .portal-hero h1 { font-size: 31px; }
  .portal-hero p { font-size: 13px; line-height: 1.6; }
  .module-card { min-height: 0; padding: 18px; gap: 14px; border-radius: 16px; }
  .module-icon { flex-basis: 48px; width: 48px; height: 48px; font-size: 24px; border-radius: 13px; }
  .module-card h2 { font-size: 20px; }
  .module-card p { min-height: 0; margin-bottom: 14px; }
}

