.portalHome {
    display: flex;
    flex-direction: column;
    max-width: none;
    padding: 28px 24px 16px;
}
.portalHeader { flex: 0 0 auto; margin-bottom: 16px; }
.portalCloudStage { flex: 1; min-height: 0; position: relative; }
.portalCloudStage:has(.is-3d) { container-type: size; }
.portalCloud {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 18px 24px;
    padding: 30px 0;
    margin: 0 auto;
    width: 100%;
    min-height: 260px;
    position: relative;
    isolation: isolate;
}

.cloudBlock {
    background: none;
    border: none;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    font-family: var(--base-font);
    color: var(--text-secondary);
    max-width: min(280px, 82%);
}
.cloudTitle {
    display: block;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cloud-xs { font-size: 16px; font-weight: 500; }
.cloud-sm { font-size: 22px; font-weight: 600; }
.cloud-md { font-size: 29px; font-weight: 650; color: var(--accent-blue); }
.cloud-lg { font-size: 36px; font-weight: 700; color: var(--accent-color); }
.cloudBlock:nth-child(3n + 1) { color: var(--accent-blue); }
.cloudBlock:nth-child(5n + 2) { color: var(--accent-color); }

.portalCloud.is-3d {
    touch-action: none;
    cursor: grab;
    display: block;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    /* Keep width <= 1.5 * height and height <= 1.3 * width within the available area. */
    width: min(100cqw, 150cqh);
    height: min(100cqh, 130cqw);
    min-height: 0;
    margin: 0;
    padding: 0;
    contain: layout paint;
    background: radial-gradient(ellipse at center, rgba(56, 189, 248, 0.045), transparent 65%);
}
.cloudConnections {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}
.cloudConnections line {
    stroke: var(--accent-blue);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}
.cloudConnections line:nth-child(3n) { stroke: var(--accent-color); }
.cloudConnections line.cloudSignal {
    stroke: url(#cloud-signal-gradient);
    stroke-width: 1.75;
    stroke-linecap: butt;
    pointer-events: none;
}
.cloudBlock.is-signaling {
    color: #eaffff;
    opacity: 1 !important;
    text-shadow: 0 0 8px rgba(0, 255, 210, 0.8);
}
.portalCloud.is-3d .cloudBlock {
    position: absolute;
    left: 50%;
    top: 50%;
    margin: 0;
}
.portalCloud.is-animated .cloudBlock { will-change: transform; }
.portalCloud.is-dragging,
.portalCloud.is-dragging .cloudBlock { cursor: grabbing; }
.cloudBlock:hover,
.cloudBlock:focus-visible {
    color: var(--text-primary);
    opacity: 1 !important;
    z-index: 1000 !important;
    background: var(--accent-glow-bg);
}
.cloudBlock:focus-visible { outline: 1px solid var(--accent-blue); outline-offset: 2px; }
.cloudEmpty { text-align: center; color: var(--text-secondary); }
@media (max-width: 600px) {
    .portalHome { padding: 24px 12px 12px; }
    .portalHeader { margin-bottom: 12px; }
    .cloud-xs { font-size: 13px; }
    .cloud-sm { font-size: 16px; }
    .cloud-md { font-size: 20px; }
    .cloud-lg { font-size: 24px; }
}
